/* =====================================================================
   Work Report Plumbing — Roto-Rooter Indonesia
   Antarmuka mobile-first (di-refresh): navy + teal, lebih lega & modern.
   Catatan: SEMUA nama class lama dipertahankan agar PHP/JS tetap jalan.
   ===================================================================== */

:root {
    /* --- Brand (navy + teal "air/aliran") --- */
    --navy-900: #06243f;
    --navy-800: #0a2e50;
    --navy-700: #0d3b66;   /* primary brand */
    --navy-600: #15518a;
    --teal-600: #0f97a6;
    --teal-500: #16b8c4;   /* accent / aktif / progres */
    --teal-300: #7fdce4;

    /* --- Netral --- */
    --bg:        #eef3f9;
    --surface:   #ffffff;
    --surface-2: #f7fafc;
    --surface-3: #eef3f8;
    --line:      #e3eaf2;
    --line-2:    #eef2f7;

    --ink:    #15242f;     /* teks utama */
    --ink-2:  #41566a;     /* teks sekunder */
    --muted:  #6f8398;     /* teks redup */

    /* --- Status --- */
    --danger:    #d6453f;
    --danger-bg: #fff3f2;
    --danger-bd: #f7cbc8;
    --success:   #1c9550;
    --success-bg:#eafaf0;
    --success-bd:#b8ecca;
    --warn:      #b3760b;
    --warn-bg:   #fff7e8;
    --warn-bd:   #f3d79b;

    /* Before / After (selaras dengan PDF) */
    --before: #b06a00;
    --after:  #2f7d4f;

    /* --- Kompatibilitas nama lama (dipakai sebagian class) --- */
    --c-primary:   var(--navy-700);
    --c-primary-d: var(--navy-800);
    --c-accent:    var(--teal-500);
    --c-bg:        var(--bg);
    --c-surface:   var(--surface);
    --c-text:      var(--ink);
    --c-muted:     var(--muted);
    --c-border:    var(--line);
    --c-danger:    var(--danger);
    --c-success:   var(--success);
    --border:      var(--line);
    --ink-var:     var(--ink);

    /* --- Bentuk & bayangan --- */
    --radius:    18px;
    --radius-sm: 13px;
    --radius-xs: 9px;
    --shadow-xs: 0 1px 2px rgba(13,38,66,.06);
    --shadow:    0 4px 16px rgba(13,38,66,.07), 0 1px 3px rgba(13,38,66,.05);
    --shadow-md: 0 10px 28px rgba(13,38,66,.10), 0 2px 6px rgba(13,38,66,.06);
    --shadow-lg: 0 18px 44px rgba(13,38,66,.16);
    --ring: 0 0 0 3px rgba(22,184,196,.28);

    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Inter", Arial, sans-serif;
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(1100px 460px at 100% -10%, rgba(22,184,196,.08), transparent 60%),
        radial-gradient(900px 420px at -5% 0%, rgba(13,59,102,.07), transparent 55%),
        linear-gradient(180deg, #f3f7fc 0%, var(--bg) 240px);
    background-attachment: fixed;
    min-height: 100dvh;
    padding-bottom: calc(88px + var(--safe-bottom));
}

a { color: var(--navy-600); }
::selection { background: rgba(22,184,196,.28); }

/* Aksesibilitas: cincin fokus yang jelas hanya untuk navigasi keyboard */
:focus-visible {
    outline: 2px solid var(--teal-500);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================ HEADER ============================ */
.app-header {
    position: sticky; top: 0; z-index: 50;
    background:
        radial-gradient(120% 160% at 90% -40%, rgba(22,184,196,.30), transparent 55%),
        linear-gradient(135deg, var(--navy-700), var(--navy-800));
    color: #fff;
    box-shadow: 0 6px 22px rgba(8,30,55,.20);
    padding-top: var(--safe-top);
    position: -webkit-sticky;
}
.app-header::after { /* garis aksen teal "aliran air" */
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--teal-500) 30%, var(--teal-300) 50%, var(--teal-500) 70%, transparent);
    opacity: .9;
}
.app-header__inner {
    max-width: 1140px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 13px 18px;
}
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.04rem; letter-spacing: .2px; min-width: 0; }
.brand__icon { font-size: 1.3rem; }
.brand__logo {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border-radius: 10px; padding: 6px 9px;
    box-shadow: 0 3px 10px rgba(0,0,0,.22);
}
.brand__logo img { height: 24px; width: auto; display: block; }
.brand__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-nav { display: none; align-items: center; gap: 4px; }
.app-nav a {
    color: rgba(255,255,255,.84); text-decoration: none;
    padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem;
    transition: background .2s var(--ease), color .2s;
}
.app-nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.app-nav a.active { background: rgba(255,255,255,.20); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.app-nav .nav-region { font-weight: 700; }
.app-nav .nav-logout { opacity: .9; }
.app-nav .nav-logout:hover { opacity: 1; }

/* ============================ FLASH ============================ */
.flash {
    max-width: 1140px; margin: 14px auto 0; padding: 14px 46px 14px 16px;
    border-radius: var(--radius-sm); font-size: .92rem; font-weight: 600; position: relative;
    width: calc(100% - 32px);
    display: flex; align-items: center; gap: 8px;
    box-shadow: var(--shadow); animation: flashIn .35s var(--ease);
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.flash::before { font-size: 1.05rem; }
.flash--success { background: var(--success-bg); color: #176b3a; border: 1px solid var(--success-bd); }
.flash--success::before { content: "✅"; }
.flash--error { background: var(--danger-bg); color: #b0231d; border: 1px solid var(--danger-bd); }
.flash--error::before { content: "⚠️"; }
.flash__close {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: inherit;
    width: 34px; height: 34px; border-radius: 8px; opacity: .7;
}
.flash__close:hover { opacity: 1; background: rgba(0,0,0,.05); }

/* ============================ LAYOUT ============================ */
.app-main { max-width: 1140px; margin: 0 auto; padding: 22px 18px 32px; }
.app-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 8px 0 22px; }

.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 1.5rem; color: var(--navy-700); font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.page-head__sub { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.page-head__sub a { color: var(--teal-600); font-weight: 600; text-decoration: none; }
.page-head__sub a:hover { text-decoration: underline; }
.page-head--row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================ CARD ============================ */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.card__header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--line-2);
    background: linear-gradient(180deg, #fbfdff, #f6f9fc);
}
.card__header h2 { font-size: 1.06rem; color: var(--navy-700); font-weight: 800; letter-spacing: -.01em; }
.card__body { padding: 20px; }

/* Step badge sebagai "node" rail — mencerminkan urutan langkah isian */
.form-step { position: relative; }
.form-step > .card__header { background: linear-gradient(180deg, #f9fcfe, #eff6fc); }
.step-badge {
    width: 32px; height: 32px; flex: 0 0 32px;
    background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
    color: #fff; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; font-size: .92rem;
    box-shadow: 0 4px 10px rgba(13,59,102,.30), inset 0 0 0 3px rgba(255,255,255,.18);
    position: relative;
}

/* ============================ FORM ============================ */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 7px; color: var(--ink-2); }
.req { color: var(--danger); font-weight: 700; }
.opt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.hint { color: var(--muted); font-size: .86rem; margin-bottom: 13px; line-height: 1.5; }
.hint strong { color: var(--ink-2); }
.sub-label { color: var(--navy-700); font-size: .92rem; font-weight: 700; margin: 16px 0 9px; }

input[type="text"], input[type="search"], input[type="date"],
input[type="datetime-local"], input[type="password"], input[type="email"],
textarea, select {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid var(--line); border-radius: var(--radius-xs);
    font-size: 16px; /* cegah zoom iOS */
    font-family: inherit; background: #fff; color: var(--ink);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s;
}
input::placeholder, textarea::placeholder { color: #9fb0c2; }
input:hover, textarea:hover, select:hover { border-color: #cdd9e6; }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--teal-500);
    box-shadow: var(--ring); background: #fff;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.55; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
.field--full { grid-column: 1 / -1; }

/* Chips (inspeksi — bila dipakai) */
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
    display: inline-block; padding: 10px 18px;
    border: 1.5px solid var(--line); border-radius: 999px;
    font-size: .9rem; font-weight: 600; color: var(--ink-2);
    background: #fff; transition: all .15s var(--ease);
}
.chip input:checked + span {
    background: var(--navy-700); color: #fff; border-color: var(--navy-700);
    box-shadow: 0 4px 12px rgba(13,59,102,.25);
}

/* ============================ BUTTONS ============================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 12px 20px; border: 1.5px solid transparent; border-radius: var(--radius-xs);
    font-size: .94rem; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: transform .12s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, filter .2s;
    font-family: inherit; line-height: 1.1; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--primary {
    background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
    color: #fff; box-shadow: 0 6px 16px rgba(13,59,102,.30);
}
.btn--primary:hover { filter: brightness(1.06); box-shadow: 0 10px 24px rgba(13,59,102,.34); }
.btn--ghost { background: #fff; color: var(--navy-700); border-color: var(--line); box-shadow: var(--shadow-xs); }
.btn--ghost:hover { border-color: var(--teal-500); color: var(--teal-600); background: #f7feff; }
.btn--danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: .82rem; border-radius: 8px; }
.btn--hero { font-size: 1rem; padding: 14px 22px; box-shadow: 0 8px 20px rgba(13,59,102,.26); }
.btn--hero.is-busy { opacity: .65; cursor: progress; }

.form-actions { margin-top: 10px; }
.form-actions--row { display: flex; gap: 10px; justify-content: flex-end; }
.inline-form { display: inline; }

/* ============================ UPLOAD ZONE ============================ */
.upload-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 30px 18px;
    border: 2px dashed #c0d0e0; border-radius: var(--radius-sm);
    background:
        radial-gradient(120% 120% at 50% 0%, #f3fbfd, transparent 70%),
        #f7fafc;
    cursor: pointer; text-align: center;
    transition: border-color .2s var(--ease), background .2s, transform .12s var(--ease);
}
.upload-zone:hover { border-color: var(--teal-500); background: #f0fbfd; }
.upload-zone:active { transform: scale(.995); }
.upload-zone__icon { font-size: 2.1rem; filter: saturate(1.1); }
.upload-zone__text { color: var(--ink-2); font-weight: 700; font-size: .92rem; }

.preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.preview-grid:empty { display: none; }
.preview-item {
    position: relative;
    border: 1px solid var(--line); border-radius: var(--radius-xs);
    overflow: hidden; background: #fff; box-shadow: var(--shadow-xs);
}
.preview-item img { width: 100%; height: 124px; object-fit: cover; display: block; background: #eef3f8; }
.preview-item input { border: none; border-top: 1px solid var(--line); border-radius: 0; font-size: 13px; padding: 9px 11px; }
.preview-item input:focus { box-shadow: none; border-top-color: var(--teal-500); }
.preview-item .remove-btn {
    position: absolute; top: 6px; right: 6px;
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: rgba(214,69,69,.94); color: #fff; font-size: 17px; cursor: pointer;
    display: grid; place-items: center; box-shadow: 0 2px 7px rgba(0,0,0,.28); line-height: 1;
    transition: transform .12s var(--ease), background .2s;
}
.preview-item .remove-btn:hover { background: #c0322c; transform: scale(1.08); }

/* Status upload bertahap */
.up-badge {
    position: absolute; top: 6px; left: 6px; z-index: 2; min-width: 22px; height: 22px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
    border-radius: 11px; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); line-height: 1;
}
.up-badge--done { background: var(--success); }
.up-badge--uploading { background: var(--warn); }
.up-badge--error { background: var(--danger); cursor: pointer; }
.upload-status { margin: 12px 0; padding: 12px 15px; border-radius: var(--radius-xs); font-size: .9rem; font-weight: 600; line-height: 1.45; }
.upload-status--busy { background: var(--warn-bg); color: #7d520a; border: 1px solid var(--warn-bd); }
.upload-status--warn { background: var(--danger-bg); color: #a32016; border: 1px solid var(--danger-bd); }

/* Drag handle & drop */
.ph-drag {
    position: absolute; left: 6px; bottom: 6px; z-index: 3; width: 26px; height: 26px; display: flex;
    align-items: center; justify-content: center; border-radius: 8px; background: rgba(13,59,102,.84); color: #fff;
    font-size: 14px; line-height: 1; cursor: grab; touch-action: none; user-select: none; box-shadow: 0 1px 4px rgba(0,0,0,.32);
}
.ph-drag:active { cursor: grabbing; }
.titik-drag, .area-drag {
    display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 32px;
    margin-right: 4px; border-radius: 8px; background: #eaf2fa; color: var(--navy-700); font-size: 16px; cursor: grab;
    touch-action: none; user-select: none; flex: none;
}
.titik-drag:active, .area-drag:active { cursor: grabbing; }
.pair-card.sorting, .area-card.sorting, .preview-item.sorting {
    opacity: .7; box-shadow: 0 10px 26px rgba(13,38,66,.28); outline: 2px dashed var(--navy-700); outline-offset: 2px;
}
.pair-col.file-drop-over, .upload-zone.file-drop-over { outline: 2px dashed var(--teal-500); outline-offset: 3px; background: #e9f9fb; }

/* ============================ EDIT FOTO LAMA ============================ */
.edit-photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 8px; }
.edit-photo { border: 1px solid var(--line); border-radius: var(--radius-xs); overflow: hidden; background: #fff; box-shadow: var(--shadow-xs); }
.edit-photo img { width: 100%; height: 124px; object-fit: cover; display: block; background: #eef3f8; }
.edit-photo input { border: none; border-top: 1px solid var(--line); border-radius: 0; font-size: 13px; padding: 9px 11px; }
.edit-photo input:focus { box-shadow: none; }
.del-check {
    display: flex; align-items: center; gap: 7px; padding: 9px 11px;
    font-size: .82rem; color: var(--danger); cursor: pointer; border-top: 1px solid var(--line); font-weight: 600;
}
.del-check input { width: auto; accent-color: var(--danger); }
.del-check--area { margin-left: auto; white-space: nowrap; font-size: .82rem; }

/* ============================ PILIH JENIS LAPORAN ============================ */
.type-choice { display: grid; grid-template-columns: 1fr; gap: 16px; }
.type-card {
    position: relative; display: flex; flex-direction: column; align-items: flex-start;
    padding: 24px 22px; text-decoration: none; color: var(--ink); cursor: pointer;
    transition: transform .14s var(--ease), box-shadow .22s var(--ease), border-color .2s;
}
.type-card::before { /* aksen atas */
    content: ""; position: absolute; left: 0; top: 0; height: 5px; width: 100%;
    background: linear-gradient(90deg, var(--navy-700), var(--teal-500));
    opacity: .85;
}
.type-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.type-card__icon {
    width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
    font-size: 30px; line-height: 1; margin-bottom: 14px;
    background: linear-gradient(135deg, #eaf2fb, #e3fbfd); color: var(--navy-700);
    box-shadow: inset 0 0 0 1px rgba(13,59,102,.07);
}
.type-card h2 { color: var(--navy-700); font-size: 1.22rem; font-weight: 800; margin-bottom: 8px; }
.type-card p { color: var(--muted); font-size: .9rem; margin-bottom: 18px; line-height: 1.55; }
.type-card p strong { color: var(--ink-2); }
.type-card .btn { margin-top: auto; }

/* ============================ MODE FOTO BERPASANGAN ============================ */
.pair-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.pair-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; box-shadow: var(--shadow-xs); }
.pair-card__head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 11px 14px; background: #fff; border-bottom: 1px solid var(--line-2);
}
.pair-card__head strong { color: var(--navy-700); }

.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
.pair-slot { border: 1px solid var(--line); border-radius: 11px; padding: 9px; background: #fff; display: flex; flex-direction: column; gap: 9px; }
.pair-slot__label, .pair-tag {
    align-self: flex-start; font-size: .72rem; font-weight: 800; color: #fff;
    padding: 4px 11px; border-radius: 999px; letter-spacing: .04em;
}
.pair-slot__label--before, .pair-tag--before { background: var(--before); }
.pair-slot__label--after,  .pair-tag--after  { background: var(--after); }
.pair-slot__img { width: 100%; height: 122px; object-fit: cover; border-radius: 9px; }
.pair-slot input[type=text] { font-size: 14px; padding: 9px 11px; }
.pair-slot__pick {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 22px 8px; border: 2px dashed #c0d0e0; border-radius: 9px;
    background: #f7fafc; cursor: pointer; color: var(--muted); font-weight: 600; font-size: .85rem; font-family: inherit;
}
.pair-slot__pick span:first-child { font-size: 1.6rem; }
.pair-slot__pick:hover { border-color: var(--teal-500); background: #f0fbfd; }
.pair-slot__change { border: none; background: #eef3f8; color: var(--navy-700); font-weight: 600; padding: 8px; border-radius: 9px; cursor: pointer; font-size: .82rem; font-family: inherit; }
.pair-slot__change:hover { background: #e1e9f1; }
.photo-empty { color: var(--muted); font-style: italic; text-align: center; padding: 30px 8px; font-size: .85rem; }

/* Judul titik yang bisa diedit */
.pair-title-input { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.pair-title-input__icon { font-size: 1.05rem; flex: 0 0 auto; }
.pair-title-field {
    flex: 1; min-width: 0; font-weight: 700; color: var(--navy-700); font-size: .98rem;
    border: 1.5px solid transparent; background: #eef3f8; padding: 9px 13px; border-radius: 10px;
    transition: border-color .15s var(--ease), background .15s, box-shadow .15s;
}
.pair-title-field:hover { background: #e6edf5; }
.pair-title-field:focus { outline: none; background: #fff; border-color: var(--teal-500); box-shadow: var(--ring); }

/* Kolom Before/After (banyak foto) */
.pair-col { border: 1px solid var(--line); border-radius: 11px; padding: 11px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.pair-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair-thumbs:empty { display: none; }
.pair-thumb { position: relative; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; box-shadow: var(--shadow-xs); }
.pair-thumb img { width: 100%; height: 94px; object-fit: cover; display: block; background: #eef3f8; }
.pair-thumb input[type=text] { border: none; border-top: 1px solid var(--line); border-radius: 0; font-size: 13px; padding: 7px 9px; min-height: 0; }
.pair-thumb input:focus { box-shadow: none; }
.pair-thumb .remove-btn {
    position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; border: none;
    background: rgba(214,69,69,.94); color: #fff; font-size: 15px; cursor: pointer; display: grid; place-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.25); line-height: 1;
}
.pair-thumb--edit .del-check { font-size: .76rem; padding: 6px 9px; justify-content: center; }
.pair-add-photo {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 13px 8px; border: 2px dashed #c0d0e0; border-radius: 9px;
    background: #f7fafc; cursor: pointer; color: var(--navy-700); font-weight: 700; font-size: .85rem; font-family: inherit;
    transition: border-color .18s var(--ease), background .18s;
}
.pair-add-photo span:first-child { font-size: 1.2rem; line-height: 1; }
.pair-add-photo:hover { border-color: var(--teal-500); background: #f0fbfd; }

/* Detail: tampilan titik */
.pair-view { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow-xs); }
.pair-view__title { padding: 12px 15px; background: linear-gradient(135deg, #eef4fa, #e6eef6); color: var(--navy-700); font-weight: 800; border-bottom: 1px solid var(--line); }
.pair-view__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 15px; }
.pair-view__col { display: flex; flex-direction: column; gap: 10px; }
.pair-view__col .pair-tag { align-self: flex-start; }

/* ============================ MODE AREA / PROYEK BESAR ============================ */
.area-list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 14px; }
.area-card { border: 1.5px solid #cdddf0; border-left: 4px solid var(--navy-700); border-radius: 14px; padding: 15px; background: linear-gradient(180deg, #f8fbff, #f3f8fd); box-shadow: var(--shadow-xs); }
.area-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.area-name-input { flex: 1; display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 11px; transition: border-color .15s, box-shadow .15s; }
.area-name-input:focus-within { border-color: var(--teal-500); box-shadow: var(--ring); }
.area-name-input__icon { font-size: 18px; }
.area-name-field { flex: 1; border: 0; outline: none; font-size: 16px; font-weight: 700; color: var(--navy-700); background: transparent; }
.area-titik-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.area-card .pair-card { background: #fff; }
.area-section .card__header { background: linear-gradient(180deg, #f5faff, #ecf4fc); }
.area-section .card__header h2 { color: var(--navy-700); }

/* Area + Detail */
.da-detail { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 12px; }
.da-label { font-size: 13px; font-weight: 700; color: var(--navy-700); margin-top: 6px; }
.da-field { width: 100%; border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 14px; font-family: inherit; resize: vertical; background: #fff; color: var(--ink); }
.da-field:focus { outline: none; border-color: var(--teal-500); box-shadow: var(--ring); }

/* ============================ FILTER BAR ============================ */
.filter-bar { padding: 15px; }
.filter-bar__main { display: flex; gap: 10px; }
.filter-bar__main input { flex: 1; }
.filter-bar__adv { display: none; margin-top: 14px; gap: 0 14px; }
.filter-bar__adv.show { display: grid; grid-template-columns: 1fr; }
.field--actions { display: flex; gap: 10px; align-items: flex-end; }

/* ============================ DAFTAR LAPORAN ============================ */
.report-list { display: grid; grid-template-columns: 1fr; gap: 16px; }
.report-card { display: flex; flex-direction: column; margin: 0; transition: transform .14s var(--ease), box-shadow .22s var(--ease); }
.report-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.report-card__body { padding: 18px 18px 10px; flex: 1; }
.report-card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.report-card__photos { font-size: .82rem; color: var(--muted); font-weight: 700; background: var(--surface-3); padding: 3px 10px; border-radius: 999px; }
.report-card__title { font-size: 1.1rem; color: var(--navy-700); margin-bottom: 10px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.report-card__meta { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.report-card__meta span { display: flex; align-items: center; gap: 6px; }
.report-card__actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); }

.badge { display: inline-block; padding: 5px 13px; border-radius: 999px; font-size: .77rem; font-weight: 800; letter-spacing: .02em; }
.badge--job { background: #e7f3ff; color: #1565a3; box-shadow: inset 0 0 0 1px rgba(21,101,163,.12); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { background: #e2fbff; color: #07697a; padding: 3px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; }

/* ============================ DETAIL ============================ */
.detail-layout { display: grid; grid-template-columns: 1fr; gap: 0; }
.detail-list { display: grid; gap: 0; }
.detail-list > div { display: grid; grid-template-columns: 1fr; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.detail-list > div:last-child { border-bottom: none; }
.detail-list dt { color: var(--muted); font-size: .82rem; font-weight: 700; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .03em; }
.detail-list dd { color: var(--ink); font-weight: 500; }
.text-block { background: var(--surface-2); padding: 13px 15px; border-radius: var(--radius-xs); margin-bottom: 8px; border: 1px solid var(--line-2); line-height: 1.6; }
.muted { color: var(--muted); font-style: italic; }

.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.photo-item { border: 1px solid var(--line); border-radius: var(--radius-xs); overflow: hidden; background: #fff; box-shadow: var(--shadow-xs); transition: transform .16s var(--ease), box-shadow .2s; }
.photo-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.photo-item a { display: block; overflow: hidden; }
.photo-item img { width: 100%; height: 150px; object-fit: cover; display: block; background: #eef3f8; transition: transform .35s var(--ease); }
.photo-item:hover img { transform: scale(1.05); }
.photo-item figcaption { padding: 9px 11px; font-size: .82rem; color: var(--ink-2); text-align: center; border-top: 1px solid var(--line-2); }
.photo-grid--mini { grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-grid--mini .photo-item img { height: 120px; }
.photo-grid--mini figcaption { padding: 6px 8px; font-size: .76rem; }

/* QR */
.qr-body { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.qr-preview { width: 220px; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; padding: 8px; box-shadow: var(--shadow-xs); }
.qr-info { flex: 1; min-width: 220px; }
.qr-info p { color: var(--ink-2); margin-bottom: 14px; line-height: 1.55; }
.qr-info .btn { margin: 0 8px 8px 0; }
.qr-section--site .card__header { background: linear-gradient(180deg, #eef7ff, #e6f1fc); }
.qr-section--site .card__header h2 { color: #1457a0; }

/* ============================ EMPTY STATE ============================ */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state__icon { font-size: 3.1rem; margin-bottom: 12px; opacity: .9; }
.empty-state h3 { color: var(--navy-700); margin-bottom: 7px; font-size: 1.16rem; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }

/* ============================ BOTTOM NAV (mobile) ============================ */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    display: flex; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(13,38,66,.10);
    padding-bottom: var(--safe-bottom);
}
.bottom-nav__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 11px 4px 9px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 700;
    transition: color .2s;
}
.bottom-nav__item.active { color: var(--navy-700); }
.bottom-nav__icon { font-size: 1.3rem; }
.bottom-nav__item--primary { color: var(--navy-700); }
.bottom-nav__item--primary .bottom-nav__icon {
    background: linear-gradient(135deg, var(--navy-700), var(--teal-600)); color: #fff; width: 50px; height: 50px;
    border-radius: 50%; display: grid; place-items: center; margin-top: -26px; font-size: 1.7rem; font-weight: 400;
    box-shadow: 0 8px 20px rgba(13,59,102,.40), 0 0 0 4px #fff; border: 0;
    transition: transform .14s var(--ease), filter .2s;
}
.bottom-nav__item--primary:active .bottom-nav__icon { transform: scale(.94); }

/* ============================ HALAMAN BANTUAN ============================ */
.help { display: flex; flex-direction: column; gap: 10px; max-width: 780px; }
.help-item { border: 1px solid var(--line); border-radius: 13px; background: #fff; overflow: hidden; box-shadow: var(--shadow-xs); }
.help-item > summary { cursor: pointer; padding: 15px 17px; font-weight: 800; color: var(--navy-700); font-size: 15px; list-style: none; display: flex; align-items: center; gap: 9px; background: linear-gradient(180deg, #fbfdff, #f6f9fc); }
.help-item > summary::-webkit-details-marker { display: none; }
.help-item > summary::after { content: '▸'; margin-left: auto; transition: transform .2s var(--ease); color: #7a8aa0; }
.help-item[open] > summary::after { transform: rotate(90deg); }
.help-body { padding: 8px 19px 17px; line-height: 1.65; color: var(--ink-2); }
.help-body p { margin: 9px 0; }
.help-body ul, .help-body ol { margin: 9px 0; padding-left: 23px; }
.help-body li { margin: 6px 0; }
.help-badges { list-style: none; padding-left: 0; }
.help-badges li { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.help-tip { background: var(--warn-bg); border: 1px solid var(--warn-bd); border-radius: 10px; padding: 10px 13px; color: #7d520a; font-size: 14px; }
.badge-demo { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; color: #fff; font-weight: 800; font-size: 12px; flex: none; }
.badge-demo--done { background: var(--success); }
.badge-demo--uploading { background: var(--warn); }
.badge-demo--error { background: var(--danger); }
.grip-demo { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 7px; background: #eaf2fa; color: var(--navy-700); font-size: 14px; }

/* ============================ HALAMAN PUBLIK LOKASI ============================ */
.public-body { padding-bottom: 32px; }
.site-hero { text-align: center; }
.site-hero__icon { font-size: 2.5rem; }
.site-hero__title { color: var(--navy-700); font-size: 1.34rem; margin: 6px 0 2px; font-weight: 800; }
.site-hero__sub { color: var(--muted); font-weight: 700; }
.site-hero__count { display: inline-block; margin-top: 12px; padding: 6px 17px; background: #e7f3ff; color: #1565a3; border-radius: 999px; font-size: .85rem; font-weight: 800; }
.site-report-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.site-report { display: flex; align-items: center; gap: 12px; margin: 0; text-decoration: none; color: inherit; padding: 0; transition: transform .12s var(--ease), box-shadow .2s; }
.site-report:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.site-report__main { flex: 1; padding: 16px; min-width: 0; }
.site-report__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.site-report__photos { font-size: .8rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.site-report__date { font-size: 1.02rem; color: var(--navy-700); font-weight: 800; margin-bottom: 6px; }
.site-report__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--muted); }
.site-report__chevron { font-size: 1.8rem; color: var(--muted); padding-right: 16px; line-height: 1; }
.public-foot { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 22px; line-height: 1.55; }

/* ============================ PDF FONT SELECT ============================ */
.pdf-group { display: inline-flex; align-items: stretch; gap: 6px; }
.pdf-fs { border: 1.5px solid var(--line); border-radius: 9px; padding: 0 10px; font-size: .85rem; background: #fff; color: var(--ink); }

/* ============================ FITUR AI ============================ */
.ai-toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.ai-toggle input { width: 20px; height: 20px; accent-color: var(--navy-700); }
.ai-inline-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--danger); cursor: pointer; }
.ai-inline-check input { accent-color: var(--danger); }
.ai-pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.ai-pill--on { background: var(--success-bg); color: #176b3a; border: 1px solid var(--success-bd); }
.ai-pill--off { background: #f1f3f5; color: #868e96; border: 1px solid #dee2e6; }
.ai-test-result { margin-top: 12px; padding: 12px 15px; border-radius: var(--radius-xs); font-size: .9rem; font-weight: 600; }
.ai-test-result--wait { background: #f1f3f5; color: var(--muted); }
.ai-test-result--ok { background: var(--success-bg); color: #176b3a; border: 1px solid var(--success-bd); }
.ai-test-result--err { background: var(--danger-bg); color: #b0231d; border: 1px solid var(--danger-bd); }
.ai-actionbar .card__body { padding: 16px 18px; }
.ai-actionbar__row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.ai-actionbar__row .btn { flex: 1 1 auto; }
.ai-progress { margin: 12px 0 4px; }
.ai-progress__bar { height: 10px; background: #e9eef3; border-radius: 999px; overflow: hidden; }
.ai-progress__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal-500), var(--navy-700)); transition: width .25s var(--ease); }
.ai-progress__label { margin-top: 6px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.ai-blocked { text-align: center; padding: 24px; }
.ai-blocked p { margin-bottom: 14px; font-weight: 600; color: var(--ink); }
.ai-photo-list { display: flex; flex-direction: column; gap: 14px; }
.ai-photo-row { display: flex; gap: 14px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: #fcfdfe; }
.ai-photo-row--applied { border-color: var(--success-bd); background: #f4fff8; }
.ai-photo-row__thumb { position: relative; flex: 0 0 110px; }
.ai-photo-row__thumb img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; display: block; border: 1px solid var(--line); }
.ai-photo-row__no { position: absolute; top: 4px; left: 4px; background: rgba(13,59,102,.86); color: #fff; font-size: .72rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.ai-photo-row__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-photo-row__ctx { font-size: .82rem; color: var(--navy-700); font-weight: 700; }
.ai-photo-row__type { display: flex; align-items: center; gap: 8px; }
.ai-photo-row__type label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.ai-type-select { padding: 7px 11px; border: 1.5px solid var(--line); border-radius: 8px; font-size: .85rem; background: #fff; color: var(--ink); }
.ai-type-select--flag { border-color: #f59f00; background: #fff9db; box-shadow: 0 0 0 2px rgba(245,159,0,.18); }
.ai-caption-field { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: .9rem; font-family: inherit; resize: vertical; }
.ai-caption-field:focus { outline: none; border-color: var(--teal-500); box-shadow: var(--ring); }
.ai-suggest { background: #f3f8fd; border: 1px dashed #b9d6ef; border-radius: 10px; padding: 10px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ai-suggest--flag { background: #fff9db; border-color: #ffe066; }
.ai-suggest__text { font-size: .85rem; color: var(--ink); flex: 1 1 200px; min-width: 0; }
.ai-suggest__cap { font-weight: 700; margin-bottom: 2px; }
.ai-suggest__meta { font-size: .78rem; color: var(--muted); }
.ai-suggest__err { color: var(--danger); font-weight: 600; }
.ai-suggest .btn { flex: 0 0 auto; }
.ai-suggest--field { margin-top: 8px; }
.ai-narrative-grid { display: flex; flex-direction: column; gap: 4px; }
.ai-edit-hint { font-weight: 400; font-size: .8rem; color: var(--muted); }
.ai-photo-row--ai { border-color: #b2d8f0; background: #f5fbff; }
.ai-rownote { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-rownote__item { font-size: .76rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #e7f3ff; color: #1565a3; }
.ai-rownote__item--move { background: #fff3bf; color: #a16207; }
.ai-rownote__item--err { background: #ffe3e3; color: var(--danger); }
.ai-preview { border: 2px solid var(--teal-500); }
.ai-pv__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ai-pv__col { min-width: 0; }
.ai-pv__h { font-size: .95rem; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.ai-pv__h--before { color: #c2410c; border-color: #ffd8a8; }
.ai-pv__h--after { color: #2f9e44; border-color: var(--success-bd); }
.ai-pv__empty { font-size: .85rem; padding: 6px 0; }
.ai-pv__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ai-pv__fig { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.ai-pv__fig img { width: 100%; height: 120px; object-fit: cover; display: block; }
.ai-pv__cap { padding: 7px 9px; display: flex; flex-direction: column; gap: 3px; }
.ai-pv__ctx { font-size: .72rem; font-weight: 700; color: var(--navy-700); }
.ai-pv__txt { font-size: .8rem; color: var(--ink); line-height: 1.35; }
.ai-pv__narr { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.ai-pv__narr-item h4 { font-size: .82rem; color: var(--navy-700); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .03em; }
.ai-pv__narr-item p { font-size: .9rem; color: var(--ink); line-height: 1.5; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (min-width: 600px) {
    .type-choice { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
    body { padding-bottom: 32px; }
    .app-nav { display: flex; }
    .bottom-nav { display: none; }

    .page-head h1 { font-size: 1.85rem; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .filter-bar__adv.show, .filter-bar__adv { grid-template-columns: repeat(4, 1fr); }

    .report-list { grid-template-columns: repeat(2, 1fr); }
    .detail-list > div { grid-template-columns: 210px 1fr; align-items: baseline; }
    .detail-list dt { margin-bottom: 0; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
    .photo-item img { height: 172px; }
    .preview-grid, .edit-photo-grid { grid-template-columns: repeat(3, 1fr); }

    /* Detail: 2 kolom, blok foto/QR melebar penuh */
    .detail-layout { grid-template-columns: 1fr 1fr; gap: 16px; }
    .detail-layout > .card:nth-child(1),
    .detail-layout > .card:nth-child(2) { grid-column: span 1; }
    .detail-layout > .card:nth-child(n+3) { grid-column: 1 / -1; }

    .site-report-list { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
    .report-list { grid-template-columns: repeat(3, 1fr); }
}

/* Penyempurnaan rasa "app" di mobile (≤767px) */
@media (max-width: 767px) {
    body { -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
    .app-header__inner { padding: 11px 16px; }
    .brand__text { font-size: .96rem; }
    .app-main { padding: 16px 15px 26px; }

    .page-head h1 { font-size: 1.32rem; }
    .page-head--row { flex-direction: column; }
    .page-head__actions { width: 100%; }
    .page-head__actions .btn { flex: 1; }
    .pdf-group { flex: 1; }
    .pdf-group .btn { flex: 1; }

    .card { border-radius: 16px; margin-bottom: 15px; }
    .card__body { padding: 16px; }

    /* Target sentuh nyaman ≥48px */
    .btn { min-height: 48px; padding: 13px 18px; }
    .btn--sm { min-height: 40px; }
    input[type="text"], input[type="search"], input[type="date"],
    input[type="datetime-local"], input[type="password"], input[type="email"],
    textarea, select { min-height: 48px; font-size: 16px; }
    textarea { min-height: 100px; }

    .chip span { padding: 12px 18px; font-size: .95rem; }
    .upload-zone { padding: 32px 18px; }

    .report-card__actions { gap: 8px; }
    .report-card__actions .btn { flex: 1 1 calc(50% - 4px); }
    .report-card__actions .inline-form { flex: 1 1 calc(50% - 4px); display: flex; }
    .report-card__actions .inline-form .btn { width: 100%; }

    .qr-info .btn { width: 100%; margin: 0 0 8px 0; }

    /* Foto besar & jelas di HP */
    .photo-item img { height: 200px; }
    .form-actions .btn--block { box-shadow: 0 8px 22px rgba(13,59,102,.30); }
}

@media (max-width: 600px) {
    .pair-grid, .pair-view__cols { grid-template-columns: 1fr; }
    .qr-body { flex-direction: column; align-items: stretch; }
    .qr-preview { width: 200px; align-self: center; }
    .ai-pv__cols { grid-template-columns: 1fr; gap: 18px; }
    .ai-pv__fig img { height: 150px; }
}

@media (max-width: 560px) {
    .ai-photo-row { flex-direction: column; }
    .ai-photo-row__thumb { flex: 0 0 auto; }
    .ai-photo-row__thumb img { width: 100%; height: 180px; }
    .ai-actionbar__row .btn { flex: 1 1 100%; }
}

@media (max-width: 480px) {
    .app-nav { gap: 10px; }
    .app-nav .nav-region { font-size: 13px; }
    .area-card { padding: 11px; }
    .area-name-field { font-size: 15px; }
}

/* Layar sangat kecil (≤380px) */
@media (max-width: 380px) {
    .app-main { padding: 14px 12px 24px; }
    .brand__text { display: none; }
    .page-head h1 { font-size: 1.22rem; }
    .report-card__actions .btn,
    .report-card__actions .inline-form { flex: 1 1 100%; }
}

/* Hormati preferensi gerak minimal */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .001ms !important; scroll-behavior: auto !important;
    }
}
