/* ==========================================================================
   PPID — penyesuaian implementasi Laravel
   Hanya menambah utilitas yang tidak ada di paket desain; nilai warna tetap
   memakai token (tidak ada hex baru kecuali warisan token).
   ========================================================================== */

/* Skip link (WCAG 2.1 AA) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 10px 16px;
  background: var(--green-900);
  color: #fff;
  border-radius: 0 0 var(--r-sm) 0;
  font-size: var(--fs-13);
  font-weight: 700;
}

.skip-link:focus {
  left: 0;
}

/* Label wajib isi */
.req {
  color: var(--danger-600);
  margin-left: 2px;
}

/* Pesan kesalahan formulir */
.field-error ul {
  margin: 4px 0 0;
  padding-left: 16px;
  list-style: disc;
}

.field-error li + li {
  margin-top: 2px;
}

/* Notifikasi inline (flash message) */
.alert-inline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--fs-13);
  line-height: 1.55;
  margin-bottom: var(--s-4);
}

.alert-inline .ico {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.alert-inline.is-success {
  background: var(--success-100);
  border-color: #C6E5D7;
  color: var(--success-700);
}

.alert-inline.is-error {
  background: var(--danger-100);
  border-color: #F2C9C4;
  color: var(--danger-700);
}

.alert-inline.is-info {
  background: var(--info-100);
  border-color: #C8DBF0;
  color: var(--info-700);
}

/* Tautan aksi di dalam tabel publik */
.table .actions a.icon-btn,
.table .actions button.icon-btn {
  text-decoration: none;
}

/* Baris tabel tanpa tautan tetap terbaca */
.table td .muted,
.text-muted {
  color: var(--ink-500);
}

/* Pagination Laravel: elemen non-aktif */
.pager .is-disabled {
  opacity: .45;
  pointer-events: none;
}

/* Tombol nonaktif */
.btn[disabled],
.btn.is-disabled {
  opacity: .55;
  pointer-events: none;
}

/* Drawer: cegah scroll halaman saat terbuka */
body.drawer-open {
  overflow: hidden;
}

/* Panel: tabel tanpa panel-body tetap punya padding */
.panel > .table-scroll {
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* Pagination di dalam footer tabel tidak menambah tinggi berlebih */
.table-foot .pager {
  margin-top: 0;
}

/* Empty state (dipakai halaman publik; versi panel ada di admin.css) */
.empty {
  padding: var(--s-9) var(--s-5);
  text-align: center;
}

.empty .icon-tile {
  margin: 0 auto var(--s-4);
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
}

.empty h3 {
  font-size: var(--fs-14);
  font-weight: 700;
  color: var(--ink-900);
}

.empty p {
  font-size: var(--fs-12);
  color: var(--ink-500);
  margin-top: 5px;
  max-width: 40ch;
  margin-inline: auto;
  line-height: 1.6;
}

.empty .btn {
  margin-top: var(--s-4);
}

/* Kategori informasi barang/jasa (kategori tambahan pada laman PPID) */
.cat-barangjasa { background: var(--gold-50); color: var(--gold-700); }

/* --------------------------------------------------------------------------
   Navigasi dropdown (struktur menu mengikuti laman PPID Kementerian Agama)
   -------------------------------------------------------------------------- */
.nav-item-wrap { position: relative; display: flex; align-items: stretch; flex: 0 0 auto; }

.nav-item-wrap > .nav-item { border: 0; background: none; cursor: pointer; font-family: inherit; }

/* Tujuh menu utama tidak boleh terpotong: teks satu baris, item tidak menyusut. */
.site-nav .nav-item { white-space: nowrap; flex: 0 0 auto; }
.site-nav .nav-cta { white-space: nowrap; }

.nav-item .caret { width: 13px; height: 13px; flex: 0 0 auto; transition: transform var(--dur-2); }
.nav-item-wrap.is-open .caret { transform: rotate(180deg); }

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  min-width: 288px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 18px 40px -18px rgba(5, 35, 27, .35);
  display: none;
}

.nav-item-wrap.is-open .nav-menu { display: block; }

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--ink-700);
  line-height: 1.4;
}

.nav-menu a:hover,
.nav-menu a.is-active { background: var(--green-50); color: var(--green-800); }
.nav-menu a .ico { width: 15px; height: 15px; color: var(--ink-400); flex: 0 0 auto; }
.nav-menu .menu-group-label {
  padding: 8px 11px 4px;
  font-size: var(--fs-11);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-400);
}

/* --------------------------------------------------------------------------
   Isi halaman (HTML dari panel pengelola)
   -------------------------------------------------------------------------- */
.prose {
  font-size: var(--fs-15);
  line-height: 1.85;
  color: var(--ink-700);
}

.prose > * + * { margin-top: var(--s-4); }

.prose h3 {
  font-family: var(--font-serif);
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -.01em;
  margin-top: var(--s-6);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.prose h4 {
  font-size: var(--fs-15);
  font-weight: 700;
  color: var(--ink-900);
  margin-top: var(--s-5);
}

.prose p { color: var(--ink-700); }

.prose ol,
.prose ul { padding-left: 1.4em; }

.prose ol { list-style: decimal; }
.prose ul { list-style: disc; }
.prose ol[type="a"] { list-style: lower-alpha; }

.prose li + li { margin-top: 6px; }
.prose li > ol,
.prose li > ul { margin-top: 6px; }

.prose strong { color: var(--ink-900); font-weight: 700; }

.prose a { color: var(--green-700); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--green-800); }

.prose .lead-quote {
  font-family: var(--font-serif);
  font-size: var(--fs-20);
  line-height: 1.6;
  color: var(--green-800);
  border-left: 3px solid var(--gold-500);
  background: var(--gold-50);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--s-5);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-13);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.prose thead th {
  background: var(--surface-3);
  text-align: left;
  font-size: var(--fs-11);
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-500);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.prose tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-700);
  vertical-align: top;
}

.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) { background: var(--surface-2); }

.prose .callout { display: block; }
.prose .callout strong { display: block; margin-bottom: 4px; color: var(--green-800); }

/* Daftar isi samping pada halaman statis */
.side-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-13);
  color: var(--ink-700);
}

.side-menu a:hover { background: var(--surface-2); color: var(--green-700); }
.side-menu a.is-active { background: var(--green-50); color: var(--green-800); font-weight: 700; }
.side-menu a .ico { width: 15px; height: 15px; color: var(--ink-400); }
.side-menu a.is-active .ico { color: var(--green-600); }

/* Statistik ringkas pada beranda */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3);
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4);
}

.stat-tile strong {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--fs-24);
  color: var(--green-800);
  line-height: 1.1;
}

.stat-tile span { font-size: var(--fs-12); color: var(--ink-500); }

@media (max-width: 1180px) {
  .site-nav .nav-item { padding: 0 var(--s-3); font-size: var(--fs-12); }
  .site-nav .nav-item .ico:not(.caret) { display: none; }
  .nav-cta { padding: 0 12px; }
}

@media (max-width: 860px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-menu { position: static; display: none; box-shadow: none; border: 0; padding: 0 0 8px 12px; min-width: 0; }
  .nav-item-wrap { display: block; }
  .nav-item-wrap.is-open .nav-menu { display: block; }
}

/* Cetak sederhana untuk maklumat/struktur */
@media print {
  .topbar,
  .masthead,
  .site-nav,
  .nav-mobile,
  .site-footer,
  .help-card,
  .side-sticky,
  .btn {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .page-hero {
    background: #fff !important;
    color: var(--ink-900) !important;
    padding: 0 0 var(--s-4);
  }

  .page-hero h1,
  .page-hero .lead,
  .hero-eyebrow {
    color: var(--ink-900) !important;
  }

  .card,
  .table-wrap {
    box-shadow: none !important;
    border: 1px solid var(--line) !important;
  }
}

/* --------------------------------------------------------------------------
   Laporan PPID: tabel rekap & tampilan cetak
   -------------------------------------------------------------------------- */
.atable tfoot th {
  background: var(--surface-2);
  font-weight: 700;
  border-top: 1px solid var(--line);
}

.atable tbody tr.is-highlight { background: rgba(201, 162, 39, .08); }

/* Kepala laporan: hanya tampil saat dicetak */
.print-head { display: none; }

/* Kertas A4 agar sesuai kebiasaan dokumen resmi di Indonesia. */
@page {
  size: A4;
  margin: 14mm;
}

@media print {
  .sidebar,
  .page-head-actions,
  .toolbar,
  .toast-wrap,
  .no-print {
    display: none !important;
  }

  .admin-shell { display: block !important; }
  .admin-main { margin-left: 0 !important; }
  .admin-page { padding: 0 !important; }

  .print-head { display: block; margin: 0 0 14px; }
  .print-head h2 { font-size: 16px; margin: 0; color: #111; }
  .print-head p { font-size: 12px; margin: 3px 0 0; color: #444; }

  .panel {
    box-shadow: none !important;
    border: 1px solid #d9d9d9 !important;
    break-inside: avoid;
    margin-bottom: 12px !important;
  }

  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  .kpi { box-shadow: none !important; border: 1px solid #e3e3e3 !important; }

  .atable { font-size: 10.5px; }
  .atable th,
  .atable td { padding: 4px 6px !important; }

  .table-scroll { overflow: visible !important; max-height: none !important; }

  body { background: #fff !important; }
}
