/* ============================================================
   Profil Aset NTT — Halaman Data Tanah (tanah.html)
   Daftar bidang tanah dari e-BMD; warna mengikuti style.css.
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #202d63;
  background: #f4f6fb;
}

/* ---- Header ---- */
.tn-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid #d7dbe5;
}
.tn-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.tn-logo { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.tn-brand span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tn-brand strong { font-size: 16px; }
.tn-brand small { font-size: 11.5px; color: #68738d; }
.tn-back {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 6px;
  background: #263567;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.tn-back:hover { background: #1d2a56; }

.tn-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

/* ---- Tab jenis aset ---- */
.tn-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  border-bottom: 2px solid #e3e7f0;
}
.tn-tab {
  margin-bottom: -2px;
  padding: 10px 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: #68738d;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.tn-tab:hover { color: #263567; }
.tn-tab.is-aktif { color: #263567; border-bottom-color: #263567; }
.tn-tab:focus-visible { outline: 2px solid #2988e8; outline-offset: -2px; }

/* ---- Penegasan tahun data ---- */
.tn-tahun-banner {
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid #f1d27a;
  border-left: 5px solid #e0a800;
  border-radius: 8px;
  background: #fff6db;
  color: #4a3a0a;
  font-size: 15px;
  line-height: 1.45;
}
.tn-tahun-banner[hidden] { display: none; }
.tn-tahun-banner b { font-size: 17px; color: #202d63; }

/* ---- Ringkasan ---- */
.tn-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.tn-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid #e3e7f0;
  border-left: 4px solid #8b5a2b;
  border-radius: 8px;
  background: #fff;
}
.tn-stat:nth-child(2) { border-left-color: #2f8f5b; }
.tn-stat:nth-child(3) { border-left-color: #2988e8; }
.tn-stat-nilai { border-left-color: #263567; }
.tn-stat[hidden] { display: none; }
.tn-stat-label { font-size: 12px; font-weight: 700; color: #66718e; }
.tn-stat b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tn-stat small { font-size: 12px; color: #66718e; font-variant-numeric: tabular-nums; }

.tn-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 12px 0 0;
  font-size: 12px;
  color: #68738d;
}
.tn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8f1fd;
  color: #1d5fae;
  font-weight: 700;
}
.tn-dot { width: 7px; height: 7px; border-radius: 50%; background: #2f8f5b; }
.tn-tahun {
  height: 30px;
  padding: 0 8px;
  border: 1px solid #dfe3eb;
  border-radius: 5px;
  background: #fff;
  color: #263567;
  font-weight: 700;
}
.tn-tahun[hidden] { display: none; }

.tn-notice {
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid #f1dca4;
  border-radius: 6px;
  background: #fff8e6;
  color: #6b5312;
  font-size: 12.5px;
}
.tn-notice[hidden] { display: none; }

/* ---- Toolbar ---- */
.tn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.tn-input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d7dbe5;
  border-radius: 6px;
  background: #fff;
  color: #202d63;
  font: inherit;
  font-size: 14px;
  min-width: 0;
}
.tn-search { flex: 1 1 320px; }
#opd { flex: 0 1 320px; }
.tn-input:focus-visible,
.tn-btn:focus-visible,
.tn-table tbody tr:focus-visible {
  outline: 2px solid #2988e8;
  outline-offset: 1px;
}
.tn-btn {
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: #263567;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tn-btn:hover { background: #1d2a56; }
.tn-btn:disabled { opacity: .55; cursor: default; }
.tn-btn-ghost {
  background: #fff;
  color: #263567;
  border: 1px solid #d7dbe5;
}
.tn-btn-ghost:hover { background: #f0f2f8; }

.tn-count { margin: 12px 0 8px; font-size: 13px; color: #4a5679; }

/* ---- Tabel ---- */
.tn-table-wrap {
  border: 1px solid #e3e7f0;
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
}
.tn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tn-table th {
  position: sticky;
  top: 0;
  padding: 10px 12px;
  background: #f5f7fc;
  border-bottom: 1px solid #e3e7f0;
  color: #4a5679;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
.tn-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: top;
}
.tn-table tbody tr { cursor: pointer; }
.tn-table tbody tr:hover { background: #f7f9fe; }
.tn-table tbody tr:last-child td { border-bottom: none; }
.tn-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tn-no { color: #8a93ab; width: 1%; }
.tn-nama { font-weight: 700; }
.tn-sub { display: block; margin-top: 2px; color: #68738d; font-size: 12px; }
.tn-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.tn-pill-ok { background: #e3f4ea; color: #1f6b41; }
.tn-pill-no { background: #fdecec; color: #a3302d; }

.tn-empty { margin: 0; padding: 32px 16px; text-align: center; color: #68738d; font-size: 14px; }
.tn-empty[hidden] { display: none; }

.tn-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
}
.tn-pager[hidden] { display: none; }

.tn-note { margin: 18px 0 0; font-size: 12px; line-height: 1.5; color: #68738d; }

/* ---- Dialog rincian ---- */
.tn-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: none;
  border-radius: 10px;
  color: #202d63;
  box-shadow: 0 18px 50px rgba(15, 25, 60, .28);
}
.tn-dialog::backdrop { background: rgba(15, 25, 60, .45); }
.tn-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #e3e7f0;
}
.tn-kicker { margin: 0 0 4px; font-size: 11.5px; font-weight: 700; color: #8b5a2b; }
.tn-dialog h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.tn-close {
  flex-shrink: 0;
  border: none;
  background: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
}
.tn-close:hover { color: #c00; }
.tn-dl {
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: 8px 14px;
  margin: 0;
  padding: 14px 18px;
  font-size: 13px;
}
.tn-dl dt { color: #68738d; }
.tn-dl dd { margin: 0; overflow-wrap: anywhere; }
.tn-dialog-foot {
  display: flex;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid #e3e7f0;
}

.tn-print { display: none; }

/* ---- Mode pop-up (tanah.html?embed=1 di dalam peta) ---- */
.tn-embed .tn-head { display: none; }
.tn-embed .tn-main { padding-top: 16px; }

/* ---- Ponsel: tabel jadi kartu ---- */
@media (max-width: 700px) {
  .tn-head { padding: 8px 16px; }
  .tn-brand small { display: none; }
  .tn-main { padding: 14px 16px 32px; }
  .tn-stat b { font-size: 22px; }
  .tn-search, #opd { flex: 1 1 100%; }
  .tn-toolbar .tn-btn { flex: 1 1 100%; }

  .tn-table-wrap { border: none; background: none; overflow: visible; }
  .tn-table thead { display: none; }
  .tn-table, .tn-table tbody, .tn-table tr, .tn-table td { display: block; width: 100%; }
  .tn-table tbody tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #e3e7f0;
    border-radius: 8px;
    background: #fff;
  }
  .tn-table td {
    display: flex;
    gap: 10px;
    padding: 4px 0;
    border: none;
    text-align: left;
  }
  .tn-table td::before {
    content: attr(data-label);
    flex: 0 0 84px;
    color: #8a93ab;
    font-size: 12px;
  }
  .tn-table td > div { flex: 1; min-width: 0; }
  .tn-table td.tn-no { display: none; }
  .tn-num { text-align: left; }
}

/* ---- Cetak / PDF ---- */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { background: #fff; }
  .tn-head, .tn-main, .tn-dialog { display: none !important; }
  .tn-print { display: block; color: #000; font-size: 9pt; }
  .tn-print h1 { margin: 0 0 2mm; font-size: 13pt; }
  .tn-print p { margin: 0 0 3mm; }
  .tn-print table { width: 100%; border-collapse: collapse; }
  .tn-print th, .tn-print td { padding: 1.4mm 1.6mm; border: 0.3pt solid #999; vertical-align: top; text-align: left; }
  .tn-print th { background: #eee; }
  .tn-print thead { display: table-header-group; }
  .tn-print tr { break-inside: avoid; }
  .tn-print .tn-num { text-align: right; }
}
