/* ==========================================================================
   Laporan Harian Riam Kanan — UI 2026
   Form dinas modern: kartu soft-shadow, tipografi rapi, aksen biru dinas.
   Semua nama class dipertahankan agar index.html & JS tetap jalan.
   ========================================================================== */

:root {
  /* --- Brand: biru dinas, versi modern --- */
  --brand-50:  #eef4ff;
  --brand-100: #dbe7fe;
  --brand-200: #bfd4fd;
  --brand-500: #3b6ef5;
  --brand-600: #2358e0;
  --brand-700: #1b46b8;
  --brand-900: #142a63;

  /* --- Netral (slate) --- */
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --line:    #e5e9f0;
  --surface: #ffffff;
  --page:    #f4f6fb;

  /* --- Status --- */
  --ok-50:    #ecfdf5;
  --ok-600:   #059669;
  --ok-700:   #047857;
  --warn-50:  #fffbeb;
  --warn-200: #fde68a;
  --danger-50: #fef2f2;
  --danger-600: #dc2626;

  /* --- Bentuk & bayangan --- */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --sh-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --sh-sm: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
  --sh-md: 0 4px 16px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .04);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* alias lama — biar aturan lain yang masih merujuk tetap valid */
  --bs-primary: var(--brand-600);
  --bs-primary-hover: var(--brand-700);
  --bs-primary-active: var(--brand-900);
  --bs-primary-subtle: var(--brand-50);
  --bs-primary-text: var(--brand-700);
  --bs-success-subtle: var(--ok-50);
  --bs-success-text: var(--ok-700);
  --bs-warning: #f59e0b;
  --bs-warning-hover: #fb923c;
  --bs-secondary: var(--ink-500);
  --bs-danger: var(--danger-600);
  --bs-danger-subtle: var(--danger-50);
  --bs-body: var(--ink-900);
  --bs-muted: var(--ink-500);
  --bs-border: var(--line);
  --bs-light: #f8fafc;
  --bs-page: var(--page);
  --radius: var(--r-md);
  --radius-card: var(--r-lg);
  --shadow-sm: var(--sh-sm);
  --shadow-nav: var(--sh-sm);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-900);
  background:
    radial-gradient(1200px 420px at 50% -200px, #e4edff 0%, rgba(228, 237, 255, 0) 72%),
    var(--page);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================ NAVBAR ============================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 11px 20px;
  padding-top: calc(11px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.navbar-brand {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink-900);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.navbar-brand::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: 0 2px 7px rgba(35, 88, 224, .35);
  flex: 0 0 auto;
}

.navbar-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.navbar-links a,
.navbar-links .soon {
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-500);
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .16s, color .16s, box-shadow .16s;
}

.navbar-links a:hover { color: var(--ink-900); background: #eef2f9; }

.navbar-links a.active {
  color: var(--brand-700);
  background: var(--brand-50);
  box-shadow: inset 0 0 0 1px var(--brand-100);
  font-weight: 600;
}

.navbar-links .soon { color: var(--ink-400); cursor: default; }

/* ============================ PAGE HEAD ============================ */

.page-head {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-size: 12.5px;
}

.breadcrumb li { display: flex; align-items: center; color: var(--ink-400); }

.breadcrumb li + li::before {
  content: "›";
  padding: 0 7px;
  color: var(--ink-300);
  font-size: 15px;
  line-height: 1;
}

.breadcrumb a { color: var(--ink-500); text-decoration: none; transition: color .15s; }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb li.active { color: var(--ink-700); font-weight: 500; }

.page-head h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.022em;
  color: var(--ink-900);
}

.page-head .lead {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-500);
}

/* ============================ BANNERS ============================ */

.info-banner,
#inapp-tip {
  max-width: 1120px;
  margin: 18px auto 0;
  padding: 12px 16px 12px 15px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.55;
  border: 1px solid;
}

.info-banner {
  background: var(--warn-50);
  border-color: var(--warn-200);
  border-left: 4px solid var(--bs-warning);
  color: #7c4a03;
}

#inapp-tip {
  background: var(--brand-50);
  border-color: var(--brand-100);
  border-left: 4px solid var(--brand-500);
  color: var(--brand-900);
}

/* ============================ LAYOUT / CARD ============================ */

.card {
  max-width: 1120px;
  margin: 16px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

.card > h2 {
  margin: 0;
  padding: 14px 20px;
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--ink-900);
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card > h2::before {
  content: "";
  width: 4px;
  height: 17px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand-500), var(--brand-700));
  flex: 0 0 auto;
}

/* seksi tabel (Tabel 1 & 2): aksen hijau biar beda dari identitas */
.card:nth-of-type(2) > h2::before,
.card:nth-of-type(3) > h2::before {
  background: linear-gradient(180deg, #34d399, var(--ok-600));
}

.card > .hint,
.card > .grid-2,
.card > table,
.card > .table-scroll-hint {
  margin-left: 20px;
  margin-right: 20px;
}

.card > .hint {
  margin-top: 14px;
  margin-bottom: 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-500);
}

.hint-inline {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-400);
}

.table-scroll-hint {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 11.5px;
  color: var(--ink-400);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px 20px;
  padding: 20px;
}

.grid-2 .full { grid-column: 1 / -1; }
.card > .grid-2 { padding: 20px 0; }

/* ============================ FORM CONTROLS ============================ */

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -.002em;
  color: var(--ink-700);
  margin-bottom: 4px;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid var(--ink-300);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
  transition: border-color .16s, box-shadow .16s, background .16s;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder { color: var(--ink-400); opacity: 1; }

input:hover:not(:focus),
select:hover:not(:focus) { border-color: #b3bfd0; }

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(59, 110, 245, .16);
}

input[required]:not(:placeholder-shown):invalid {
  border-color: #f0a8a8;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .10);
}

select {
  background-image:
    url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m3 6 5 5 5-5'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px 14px;
  padding-right: 34px;
  cursor: pointer;
}

/* ============================ TANGGAL ============================ */

.date-dropdowns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.date-dropdowns select { margin-top: 0; flex: 1 1 0; min-width: 90px; }

.hari-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 999px;
  white-space: nowrap;
}

.hari-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-500);
  flex: 0 0 auto;
}

/* ============================ BUTTONS ============================ */

button,
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s,
              box-shadow .16s, transform .08s;
}

button:active:not(:disabled) { transform: translateY(1px); }

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  border-color: var(--brand-600);
  box-shadow: 0 1px 2px rgba(27, 70, 184, .2), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  border-color: var(--brand-700);
  box-shadow: 0 4px 14px rgba(35, 88, 224, .28);
}
.btn-primary:active { background: var(--brand-700); }

.btn-secondary {
  color: var(--brand-700);
  background: #fff;
  border-color: var(--brand-200);
  box-shadow: var(--sh-xs);
}
.btn-secondary:hover {
  background: var(--brand-50);
  border-color: var(--brand-500);
  color: var(--brand-700);
}

.btn-ghost {
  color: var(--ink-500);
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--sh-xs);
}
.btn-ghost:hover { background: #f6f8fc; color: var(--ink-900); border-color: var(--ink-300); }

button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.btn-mini {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 12px;
  flex: 1 1 0;
  border-radius: var(--r-sm);
}

/* tombol "+ Tambah Baris" di header seksi */
.btn-add {
  min-height: 30px;
  margin-left: auto;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ok-700);
  background: var(--ok-50);
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  box-shadow: none;
}
.btn-add:hover { background: #d1fae5; border-color: #6ee7b7; color: var(--ok-700); }

.btn-remove {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: var(--danger-600);
  background: var(--danger-50);
  border: 1px solid #fecaca;
  border-radius: 50%;
  box-shadow: none;
}
.btn-remove:hover { background: #fee2e2; border-color: #fca5a5; }

/* ============================ UPLOAD FOTO ============================ */

.hidden-file {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-700);
  background: #fff;
  border: 1px dashed var(--brand-200);
  border-radius: var(--r-md);
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, color .16s, border-color .16s;
}
.btn-upload:hover { background: var(--brand-50); border-color: var(--brand-500); }

.btn-upload.has-files {
  color: var(--ok-700);
  background: var(--ok-50);
  border-style: solid;
  border-color: #a7f3d0;
}

.btn-upload-block { width: 100%; }

.preview-img {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.preview-img:empty { display: none; }
.preview-img img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-xs);
}
.preview-img small { font-size: 11px; color: var(--ink-400); }

/* ============================ TABEL ============================ */

table.data {
  display: block;
  width: calc(100% - 40px);
  max-width: calc(100% - 40px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 20px;
}

table.data thead th {
  padding: 10px 11px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .05em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ink-500);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data thead th small {
  display: block;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--ink-400);
}

table.data tbody td {
  padding: 8px 11px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
  min-width: 118px;
}

table.data tbody tr:nth-child(even) td { background: #fcfdff; }
table.data tbody tr:hover td { background: #f5f8ff; }
table.data tbody tr:last-child td { border-bottom: none; }

table.data td.num {
  min-width: 34px;
  width: 34px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-400);
}

table.data input,
table.data select {
  margin-top: 0;
  min-height: 38px;
  font-size: 14px;
  box-shadow: none;
}

select.sel-tanggal { min-width: 150px; }
input.inp-jam { min-width: 88px; letter-spacing: .02em; }

/* --- Lokasi / Jenis Pekerjaan: dropdown + opsi "Lainnya" --- */
.pilih-cust { display: flex; flex-direction: column; gap: 5px; min-width: 132px; }
.pilih-cust .pc-sel { margin-top: 0; }
.pilih-cust .pc-teks { margin-top: 0; }
.pilih-cust .pc-teks[style*="display: none"] { display: none !important; }

table.data .pilih-cust .pc-sel,
table.data .pilih-cust .pc-teks {
  min-height: 38px;
  font-size: 14px;
}

/* ============================ TANDA TANGAN ============================ */

.sig-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fcfdff;
}

.sig-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
}
.sig-label span { font-size: 11.5px; font-weight: 400; color: var(--ink-400); }
.sig-label span:not(:empty)::before {
  content: "—";
  margin-right: 5px;
  color: var(--ink-300);
}

.sig-pad {
  display: block;
  width: 100%;
  height: 150px;
  aspect-ratio: 640 / 200;
  background:
    linear-gradient(to top, #dbe2ec 0 1px, transparent 1px) 0 78% / 100% 1px no-repeat,
    #fff;
  border: 1.5px dashed var(--ink-300);
  border-radius: var(--r-md);
  touch-action: none;            /* wajib: biar nggambar gak nge-scroll */
  -webkit-user-select: none;
  user-select: none;
  cursor: crosshair;
  transition: border-color .16s, box-shadow .16s;
}
.sig-pad:active,
.sig-pad:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 110, 245, .12);
  outline: none;
}

.sig-actions { display: flex; gap: 8px; }
.sig-upload { margin-top: 4px; }

/* ============================ ACTION BAR ============================ */

.action-bar {
  max-width: 1120px;
  margin: 18px auto 0;
  padding: 14px 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
}

.action-bar .btn-primary {
  padding-left: 22px;
  padding-right: 22px;
}

#upload-status:not(:empty) {
  max-width: 1120px;
  margin: 14px auto 0;
  padding: 11px 16px;
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--r-md);
}

#upload-info {
  max-width: 1120px;
  margin: 12px auto 0;
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
  color: var(--ink-400);
}

/* ============================ PANEL HASIL ============================ */

.hasil-panel {
  max-width: 1120px;
  margin: 16px auto 0;
  padding: 18px;
  background: var(--ok-50);
  border: 1px solid #a7f3d0;
  border-left: 4px solid var(--ok-600);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  animation: pop .22s ease-out;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}

.hasil-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ok-700);
  margin-bottom: 3px;
}

.hasil-file {
  font-size: 12px;
  color: #0f766e;
  margin-bottom: 14px;
  word-break: break-all;
}

.hasil-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.btn-hasil {
  flex: 1 1 40%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hasil-tip {
  margin-top: 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #0f766e;
}

/* ============================ PROFIL TERSIMPAN ============================ */
/* Identitas petugas (nama, wilayah, pengamat) disimpan per HP via
   localStorage. Profil beda dgn draf: profil = identitas awal form,
   draf = seluruh isian laporan yang belum dikirim. */

.profil-banner {
  max-width: 1120px;
  margin: 16px auto 0;
  padding: 12px 18px;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  background: #f5faff;
  border: 1px solid #cfe6fb;
  border-left: 4px solid #0284c7;
  border-radius: var(--r-md);
}
.profil-banner.on { display: flex; }
.profil-banner-teks { font-size: 13px; color: #075985; }
.profil-banner-teks small { display: block; color: var(--ink-400); margin-top: 2px; }
.profil-banner-aksi { display: flex; flex-wrap: wrap; gap: 8px; }
.profil-banner-aksi button { flex: 0 0 auto; }

#profil-pilih {
  width: auto;
  min-width: 200px;
  max-width: 100%;
  min-height: 36px;
  margin-top: 0;
  padding: 5px 30px 5px 10px;
  font-size: 12.5px;
}

.pb-input { width: 210px; min-height: 36px; margin-top: 0; font-size: 13px; }

.pb-btn {
  min-height: 0;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  cursor: pointer;
  box-shadow: none;
}
.pb-btn:hover { background: #f6f8fc; }
.pb-btn.btn-primary {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.pb-btn.btn-primary:hover { background: var(--brand-700); }

.profil-aksi {
  max-width: 1120px;
  margin: 14px auto 0;
  padding: 0 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.profil-aksi[hidden] { display: none; }
.profil-aksi button {
  min-height: 0;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  box-shadow: none;
  cursor: pointer;
  flex: 0 0 auto;
}
.profil-aksi button:hover { background: #f6f8fc; }
.profil-aksi button.btn-primary {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
#profil-status { font-size: 11.5px; color: var(--ink-400); }

.profil-toast {
  display: none;
  position: sticky;
  bottom: calc(14px + env(safe-area-inset-bottom, 0));
  z-index: 80;
  margin: 12px auto 0;
  width: fit-content;
  max-width: 92%;
  background: #0f172a;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .28);
}
.profil-toast.on { display: block; }

#profil-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 3px 9px;
  border-radius: 999px;
  vertical-align: middle;
}
/* WAJIB: atribut [hidden] harus menang atas display:inline-flex */
#profil-badge[hidden] { display: none !important; }

/* ============================ DRAF OTOMATIS ============================ */

.draf-banner {
  max-width: 1120px;
  margin: 16px auto 0;
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-left: 4px solid var(--brand-500);
  border-radius: var(--r-md);
}

.draf-banner-teks { font-size: 13px; color: var(--brand-900); }
.draf-banner-teks span { font-size: 11.5px; color: var(--ink-400); }

/* pemilih draf kalau di browser yang sama ada beberapa petugas */
.draf-pilih-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--ink-500);
}
.draf-pilih-wrap select {
  width: auto;
  min-width: 190px;
  max-width: 100%;
  min-height: 34px;
  margin-top: 0;
  padding: 5px 30px 5px 10px;
  font-size: 12.5px;
}

.draf-banner-aksi { display: flex; flex-wrap: wrap; gap: 8px; }
.draf-banner-aksi button { flex: 0 0 auto; }

.draf-info {
  max-width: 1120px;
  margin: 12px auto 0;
  padding: 0 20px;
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
  color: var(--ink-400);
}
.draf-info:empty { display: none; }

/* ============================ FOOTER ============================ */

footer {
  max-width: 1120px;
  margin: 32px auto 40px;
  padding: 0 20px;
  text-align: center;
}
footer small { font-size: 11.5px; color: var(--ink-400); }

/* ============================================================
   HARDENING HP / ANDROID
   ============================================================ */

a, button, label, select, input,
.btn-upload, .btn-primary, .btn-secondary, .btn-ghost {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 860px) {

  .navbar-inner { padding: 9px 14px; gap: 10px; }
  .navbar-brand { font-size: 15px; }
  .navbar-brand::before { width: 24px; height: 24px; border-radius: 7px; }
  .navbar-links { display: none; }

  .breadcrumb { display: none; }

  .page-head { padding: 18px 14px 0; }
  .page-head h1 { font-size: 21px; }
  .page-head .lead { font-size: 13px; }

  .info-banner, #inapp-tip { margin-left: 14px; margin-right: 14px; }

  .card { margin: 14px; border-radius: 12px; }
  .card > h2 { padding: 12px 15px; font-size: 14px; }
  .card > .hint, .card > .grid-2, .card > table, .card > .table-scroll-hint {
    margin-left: 14px; margin-right: 14px;
  }
  .card > .grid-2 { padding: 16px 0; }
  .grid-2 { gap: 16px; }

  .table-scroll-hint { display: none; }

  /* ============ Tabel jadi KARTU PER BARIS ============
     Di HP, tabel lebar (10-11 kolom) lebih enak dibaca bertumpuk ke bawah
     daripada digeser ke samping. Tiap <td> jadi 1 baris "Label: isi" pakai
     data-label yang ada di HTML. Tampilan desktop tidak berubah. */
  .card > table.data,
  table.data {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 12px 4px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  table.data thead { display: none; }
  table.data tbody { display: block; }

  table.data tr {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--sh-xs);
    overflow: hidden;
    margin-bottom: 12px;
  }

  /* matikan striping & hover gaya tabel */
  table.data tbody tr:nth-child(even) td,
  table.data tbody tr:hover td { background: transparent; }

  table.data tbody td {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 8px 13px;
    border-bottom: 1px solid #f1f5f9;
  }
  table.data tbody td:last-child { border-bottom: 0; }

  /* Label kolom di ATAS isinya, dan isinya selebar kartu.
     Sengaja tidak berdampingan: nilai panjang ("Cek Level Air dan Bangunan",
     "03/10/2026 (Sabtu)") kepotong kalau cuma dapat separuh lebar. */
  table.data tbody td[data-label] {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  table.data tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: none;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    line-height: 1.3;
    color: var(--ink-400);
  }

  /* isi sel selebar kartu */
  table.data tbody td > * { flex: 0 0 auto; width: 100%; min-width: 0; margin-top: 0; }
  /* .hidden-file WAJIB dikecualikan: input file tersembunyi tidak boleh ikut
     dilebarkan 100%, kalau ikut dia meluber ke luar layar. */
  table.data tbody td > .hidden-file { flex: 0 0 0; width: 0; height: 0; }
  table.data tbody td > button.btn-remove { flex: 0 0 auto; width: auto; }
  table.data tbody td .preview-img { flex: 1 1 auto; min-width: 0; }

  /* sel nomor jadi judul kartu: "Baris 1" */
  table.data tbody td.num {
    background: #f8fafc !important;
    border-bottom: 1px solid var(--line);
    padding: 9px 13px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-500);
    min-width: 0;
    width: 100%;
  }
  table.data tbody td.num::before {
    content: "Baris";
    flex: 0 0 auto;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--ink-400);
  }

  table.data input:not(.hidden-file),
  table.data select { width: 100%; }

  /* target sentuh min 44px */
  button, .btn-primary, .btn-secondary, .btn-ghost { min-height: 44px; }
  input[type="text"], input[type="date"], input[type="time"], select { min-height: 44px; }
  table.data input, table.data select { min-height: 44px; }
  .btn-upload { min-height: 42px; }

  /* dropdown Lokasi/Pekerjaan/Jabatan: aturan dasarnya 38px, dinaikkan */
  table.data .pilih-cust .pc-sel,
  .pilih-cust .pc-sel,
  .pilih-cust .pc-teks { min-height: 44px; }

  /* tombol "+ Tambah Baris" & tombol hapus baris: kekecilan buat jempol */
  .btn-add { min-height: 38px; padding: 8px 16px; font-size: 12.5px; }
  .btn-remove { width: 34px; height: 34px; min-height: 34px; font-size: 17px; }

  .navbar-links a,
  .navbar-links .soon { padding: 9px 12px; }

  .sig-wrap { padding: 12px; }

  .action-bar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 14px 14px 0 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 24px rgba(15, 23, 42, .10);
    border-bottom: 0;
  }
  .action-bar button { flex: 1 1 30%; font-size: 12.5px; }
  .btn-hasil { flex: 1 1 100%; }

  .profil-banner, .draf-banner, .hasil-panel {
    margin-left: 14px;
    margin-right: 14px;
  }
  .draf-banner-aksi { width: 100%; }
  .draf-banner-aksi button { flex: 1 1 0; }
  .draf-info { padding: 0 14px; }
  #upload-status, #upload-info { margin-left: 14px; margin-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media print {
  .navbar, .breadcrumb, .action-bar, #inapp-tip, .info-banner,
  #upload-status, #upload-info, .hasil-panel, footer { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ============================ PENYEMPURNAAN ============================ */

/* baris Tabel 2: kasih ruang buat tombol hapus di kolom terakhir */
table.data tbody tr.row-kerja td:last-child { min-width: 150px; text-align: center; }

/* pratinjau banyak foto: thumbnail agak lebih besar */
.preview-img.multi img { width: 56px; height: 56px; }
.preview-img.multi small { width: 100%; }

/* nilai jam / lokasi hasil gabungan dropdown (cuma buat dikirim ke server) */
.tp-val,
.pc-val { display: none !important; }
