/* =====================================================================
   PBSI Kota Depok — Laporan manajemen (tampilan eksekutif)
   Terang & gelap (kelas .dark Filament), siap cetak A4.
   ===================================================================== */
.rpt, .rpt-table, .rpt-kpis {
  --rpt-green: #0B7A3B; --rpt-green-2: #14A350; --rpt-gold: #F5B700;
  --rpt-ink: #0F172A; --rpt-muted: #64748B; --rpt-line: #E5E9EF; --rpt-soft: #F6F8FA;
  --rpt-card: #FFFFFF; --rpt-bar: linear-gradient(90deg, rgba(11,122,59,.22), rgba(20,163,80,.38));
}
.dark .rpt, .dark .rpt-table, .dark .rpt-kpis {
  --rpt-ink: #F1F5F9; --rpt-muted: #94A3B8; --rpt-line: rgba(255,255,255,.08); --rpt-soft: rgba(255,255,255,.03);
  --rpt-card: rgba(255,255,255,.035); --rpt-bar: linear-gradient(90deg, rgba(20,163,80,.25), rgba(245,183,0,.35));
}
.rpt { display: flex; flex-direction: column; gap: 1.1rem; color: var(--rpt-ink); }
.rpt-muted { color: var(--rpt-muted); font-size: .82rem; }
.rpt-strong { font-weight: 600; }

/* Kop laporan */
.rpt-mast { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem; border-radius: 1rem; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(600px 220px at 100% 0%, rgba(245,183,0,.28), transparent 60%), linear-gradient(120deg, #0A3A22, #0E6B36 60%, #0B7A3B); }
.rpt-mast::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 56px, rgba(255,255,255,.04) 56px 58px); pointer-events: none; }
.rpt-mast__brand { display: flex; gap: .8rem; align-items: center; position: relative; z-index: 1; }
.rpt-mast__brand img { height: 2.6rem; width: auto; }
.rpt-mast__brand small { display: block; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.rpt-mast__brand strong { font: 600 1.15rem/1.1 Oswald, sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.rpt-mast__meta { display: grid; grid-template-columns: repeat(4, auto); gap: .3rem 2rem; position: relative; z-index: 1; }
.rpt-mast__meta span { display: block; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,214,10,.85); font-weight: 700; }
.rpt-mast__meta b { font-size: .9rem; font-weight: 600; }

.rpt-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .8rem; color: var(--rpt-muted); }
.rpt-chip { display: inline-flex; padding: .18rem .6rem; border-radius: 999px; background: rgba(11,122,59,.08); color: var(--rpt-green); font-weight: 600; border: 1px solid rgba(11,122,59,.18); }
.dark .rpt-chip { background: rgba(245,183,0,.1); color: #FFD60A; border-color: rgba(245,183,0,.25); }

/* Periode */
.rpt-period { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; justify-content: space-between; }
.rpt-period__presets { display: inline-flex; padding: 4px; gap: 2px; border-radius: .7rem; background: var(--rpt-soft); border: 1px solid var(--rpt-line); }
.rpt-period__presets a { padding: .38rem .8rem; border-radius: .5rem; font-size: .82rem; font-weight: 600; color: var(--rpt-muted); transition: all .15s; }
.rpt-period__presets a:hover { color: var(--rpt-ink); }
.rpt-period__presets a.on { background: var(--rpt-card); color: var(--rpt-green); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.dark .rpt-period__presets a.on { background: rgba(255,255,255,.08); color: #FFD60A; }
.rpt-period__custom { display: flex; gap: .5rem; align-items: center; font-size: .8rem; color: var(--rpt-muted); }
.rpt-period__custom input { border: 1px solid var(--rpt-line); border-radius: .55rem; padding: .35rem .6rem; font-size: .85rem; background: var(--rpt-card); color: var(--rpt-ink); }
.dark .rpt-period__custom input { color-scheme: dark; }

/* KPI */
.rpt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; }
.rpt-kpi { position: relative; padding: 1rem 1.15rem; border-radius: .9rem; background: var(--rpt-card); border: 1px solid var(--rpt-line); box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: hidden; }
.rpt-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rpt-green); opacity: .7; }
.rpt-kpi.is-accent::before { background: var(--rpt-gold); opacity: 1; }
.rpt-kpi.is-accent { background: linear-gradient(135deg, rgba(245,183,0,.08), transparent 60%), var(--rpt-card); }
.rpt-kpi__top { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--rpt-muted); }
.rpt-kpi__top svg { color: var(--rpt-green); opacity: .8; }
.dark .rpt-kpi__top svg { color: #FFD60A; }
.rpt-kpi__value { margin-top: .35rem; font: 600 1.9rem/1.1 Oswald, sans-serif; color: var(--rpt-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.rpt-kpi__hint { margin-top: .2rem; font-size: .78rem; color: var(--rpt-muted); }

/* Ringkasan */
.rpt-insight { display: flex; gap: .9rem; padding: 1rem 1.2rem; border-radius: .9rem; border: 1px solid rgba(11,122,59,.2); background: linear-gradient(135deg, rgba(11,122,59,.06), rgba(245,183,0,.05)); }
.rpt-insight__icon { flex: 0 0 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: .6rem; background: rgba(245,183,0,.18); color: #A57C00; }
.dark .rpt-insight__icon { color: #FFD60A; }
.rpt-insight h3 { margin: 0 0 .3rem; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--rpt-green); }
.dark .rpt-insight h3 { color: #4ADE80; }
.rpt-insight ul { margin: 0; padding-left: 1.05rem; list-style: disc; display: grid; gap: .2rem; font-size: .9rem; line-height: 1.5; }
.rpt-insight b { color: var(--rpt-ink); }

/* Kartu isi */
.rpt-body { display: grid; gap: 1rem; }
.rpt-body.has-chart { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
.rpt-card { border-radius: 1rem; background: var(--rpt-card); border: 1px solid var(--rpt-line); box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: hidden; }
.rpt-card__head { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1.2rem; border-bottom: 1px solid var(--rpt-line); }
.rpt-card__head h3 { margin: 0; font-size: .95rem; font-weight: 650; }
.rpt-chart .fi-wi-chart, .rpt-chart .fi-section { border: 0 !important; box-shadow: none !important; background: transparent !important; ring: 0; --tw-ring-shadow: 0 0 #0000 !important; }
.rpt-chart .fi-section-header { display: none; }
.rpt-chart .fi-section-content { padding: 1rem 1.2rem 1.2rem; }

/* Tabel */
.rpt-table { font-size: .875rem; }
.rpt-table__tools { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem 1.2rem; border-bottom: 1px solid var(--rpt-line); }
.rpt-search { display: flex; align-items: center; gap: .45rem; padding: .35rem .7rem; border-radius: .55rem; border: 1px solid var(--rpt-line); background: var(--rpt-soft); color: var(--rpt-muted); min-width: 240px; }
.rpt-search input { border: 0; background: transparent; outline: none; font-size: .85rem; width: 100%; color: var(--rpt-ink); padding: 0; box-shadow: none; }
.rpt-table__scroll { overflow: auto; max-height: 70vh; }
.rpt-table.is-compact .rpt-table__scroll { max-height: none; }
.rpt-table table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rpt-table thead th { position: sticky; top: 0; z-index: 1; background: var(--rpt-soft); backdrop-filter: blur(6px); text-align: left; padding: .6rem .9rem; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--rpt-muted); border-bottom: 1px solid var(--rpt-line); white-space: nowrap; }
.dark .rpt-table thead th { background: #1b1d22; }
.rpt-table thead th button { display: inline-flex; align-items: center; gap: .3rem; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.rpt-table thead th button:hover { color: var(--rpt-ink); }
.rpt-sort { width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; opacity: .25; margin-top: 4px; }
.rpt-sort.asc { border-top-color: transparent; border-bottom-color: var(--rpt-green); opacity: 1; margin-top: -4px; }
.rpt-sort.desc { border-top-color: var(--rpt-green); opacity: 1; }
.rpt-table td { padding: .62rem .9rem; border-bottom: 1px solid var(--rpt-line); vertical-align: middle; }
.rpt-table tbody tr:nth-child(even) td { background: var(--rpt-soft); }
.rpt-table tbody tr:hover td { background: rgba(11,122,59,.06); }
.rpt-table .t-number, .rpt-table .t-share { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-table th.t-number, .rpt-table th.t-share { text-align: right; }
.rpt-table th.t-number button, .rpt-table th.t-share button { flex-direction: row-reverse; }
.rpt-table .t-rank { width: 3rem; text-align: center; }
.rpt-table td.t-number { position: relative; min-width: 9rem; }
.rpt-table td.t-number b { position: relative; z-index: 1; font-weight: 650; }
.rpt-bar { position: absolute; inset: .45rem .9rem; display: flex; justify-content: flex-end; pointer-events: none; }
.rpt-bar span { display: block; height: 100%; border-radius: .35rem; background: var(--rpt-bar); min-width: 2px; }
.rpt-table td.t-share { color: var(--rpt-muted); font-weight: 600; width: 5.5rem; }
.rpt-rank { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .3rem; border-radius: .45rem; font-size: .75rem; font-weight: 700; color: var(--rpt-muted); background: var(--rpt-soft); border: 1px solid var(--rpt-line); }
.rpt-rank.r1 { background: linear-gradient(135deg, #FFE45C, #E5B800); color: #3B2C00; border-color: transparent; }
.rpt-rank.r2 { background: linear-gradient(135deg, #E2E8F0, #A9B4C2); color: #1E293B; border-color: transparent; }
.rpt-rank.r3 { background: linear-gradient(135deg, #F3C49B, #C27C45); color: #3A1D06; border-color: transparent; }
.rpt-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .16rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--rpt-soft); border: 1px solid var(--rpt-line); white-space: nowrap; }
.rpt-badge::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; opacity: .8; }
.rpt-badge.success { color: #15803D; background: #ECFDF3; border-color: #BBF7D0; }
.rpt-badge.warning { color: #A16207; background: #FEFCE8; border-color: #FDE68A; }
.rpt-badge.danger { color: #B91C1C; background: #FEF2F2; border-color: #FECACA; }
.dark .rpt-badge.success { color: #4ADE80; background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); }
.dark .rpt-badge.warning { color: #FACC15; background: rgba(250,204,21,.1); border-color: rgba(250,204,21,.25); }
.dark .rpt-badge.danger { color: #F87171; background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.25); }
.rpt-table tfoot td { position: sticky; bottom: 0; background: var(--rpt-card); font-weight: 700; border-top: 2px solid rgba(11,122,59,.35); border-bottom: 0; }
.dark .rpt-table tfoot td { background: #1b1d22; }
.rpt-empty { text-align: center; padding: 2.5rem 1rem !important; color: var(--rpt-muted); }
.rpt-table.is-compact td, .rpt-table.is-compact th { padding-left: .6rem; padding-right: .6rem; }
.rpt-widget .fi-section-content { padding: 0 !important; }
.rpt-widget .rpt-table.is-compact { padding: .2rem .4rem .6rem; }

.rpt-print-title { display: none; }
.rpt-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .72rem; color: var(--rpt-muted); border-top: 1px dashed var(--rpt-line); padding-top: .7rem; }

@media (max-width: 1200px) { .rpt-body.has-chart { grid-template-columns: 1fr; } .rpt-mast__meta { grid-template-columns: repeat(2, auto); } }
@media (max-width: 640px) { .rpt-mast__meta { grid-template-columns: 1fr 1fr; gap: .5rem 1rem; } .rpt-search { min-width: 0; flex: 1; } }

/* Cetak / simpan PDF (A4) */
@media print {
  @page { size: A4; margin: 12mm 12mm 14mm; }
  html, body { background: #fff !important; }
  .fi-layout, .fi-main-ctn, .fi-main, .fi-page, .fi-body, .fi-page-content { min-height: 0 !important; height: auto !important; display: block !important; }
  .pbsi-footer-version, .fi-footer, body > footer, .fi-main-ctn > footer { display: none !important; }
  .fi-sidebar, .fi-topbar, .fi-header, .fi-page-header-main-ctn > .fi-header, .no-print, .rpt-table__tools, .fi-sidebar-close-overlay, .fi-footer, .pbsi-version { display: none !important; }
  .fi-main, .fi-page, .fi-main-ctn { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .rpt, .rpt-table, .rpt-kpis { --rpt-ink: #0F172A; --rpt-muted: #475569; --rpt-line: #D7DEE6; --rpt-soft: #F4F6F8; --rpt-card: #fff; }
  .rpt-mast, .rpt-kpi, .rpt-rank, .rpt-badge, .rpt-bar span, .rpt-insight, .rpt-table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rpt, .rpt-body, .rpt-body.has-chart { display: block !important; }
  .rpt > * + *, .rpt-body > * + * { margin-top: .8rem; }
  .rpt-kpis { display: grid !important; }
  .rpt-chart { break-inside: avoid; }
  .rpt-table__scroll { max-height: none !important; overflow: visible !important; }
  .rpt-table thead { display: table-header-group; }
  .rpt-table tr { break-inside: avoid; }
  .rpt-kpi__value { font-size: 1.4rem; }
  .rpt-kpis { grid-template-columns: repeat(4, 1fr); gap: .5rem; }
  .rpt-kpi { padding: .7rem .8rem; }
  .rpt-print-title { display: block; margin: .2rem 0 .1rem; }
  .rpt-print-title h1 { font: 600 1.5rem/1.2 Oswald, sans-serif; text-transform: uppercase; margin: 0; color: #0A3A22; }
  .rpt-print-title p { margin: .2rem 0 0; font-size: .85rem; color: #475569; }
  .rpt-chart canvas { width: 100% !important; height: auto !important; max-height: 220px; object-fit: contain; }
  .rpt-chart [style*="max-height"], .rpt-chart .fi-wi-chart-canvas-ctn { max-height: 230px !important; height: 230px !important; }
  .rpt-chart .fi-section-content { padding: .4rem .8rem !important; }
  .rpt-card__head { padding: .5rem .9rem; }
  .rpt-mast__meta { grid-template-columns: repeat(4, auto); }
  .rpt-card, .rpt-kpi { box-shadow: none; }
}
.rpt-kpi.is-text .rpt-kpi__value { font-size: 1.35rem; line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: .5rem; }
