/* ==========================================================================
   COMPACT DATA SYSTEM UI — Bank DMS
   Gaya: enterprise data terminal, high-density, efficient
   ========================================================================== */

/* ── RESET & BASE ───────────────────────────────────────────── */
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hv); }
ul { list-style: none; }
table { border-collapse: collapse; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ── CSS VARIABLES ──────────────────────────────────────────── */
#container {padding: 5px 5px;}
:root {
  --primary: #059669;
  --primary-hv: #047857;
  --primary-sub: #10b981;
  --primary-bg: #ecfdf5;
  --primary-ring: rgba(5,150,105,.25);
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --bg: #eef1f6;
  --surface: #ffffff;
  --border: #d4d9e4;
  --border-hv: #bcc2d0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --nav-bg: #0c0e15;
  --nav-text: #94a3b8;
  --nav-text-hv: #f1f5f9;
  --nav-active: #059669;
  --font-sm: 11px;
  --font-xs: 10px;
  --rad: 4px;
  --rad-sm: 3px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 4px rgba(0,0,0,.03);
  --shadow-hv: 0 2px 8px rgba(0,0,0,.07);
  --transition: 120ms ease;
  --hijau: #059669;
  --kuning: #e8b800;
  --biru: #0000FF;
  --gold: #FFD700;
  --merah: #dc2626;
}

/* ── LAYOUT ─────────────────────────────────────────────────── */
.dash-app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── TOP NAVIGATION ─────────────────────────────────────────── */
.topnav {
  background: var(--nav-bg);
  color: var(--nav-text);
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
  user-select: none;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
  padding-right: 16px;
  border-right: 1px solid rgba(255,255,255,.08);
}
.topnav-brand img { height: 22px; width: auto; }
.topnav-brand span { font-size: 13px; font-weight: 700; color: #e2e8f0; letter-spacing: -.02em; }
.nav-link { /* admin topnav only — scoped below */
}
.topnav .nav-link {
  color: var(--nav-text);
  padding: 6px 10px;
  border-radius: var(--rad-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.topnav .nav-link:hover { background: rgba(255,255,255,.06); color: var(--nav-text-hv); }
.topnav .nav-link.active { color: var(--nav-active); }
.topnav .nav-link .arrow { font-size: 8px; margin-left: 3px; }
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Nav dropdown */
.nav-dd { position: relative; }
.nav-dd-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 170px;
  background: #1a1d27;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--rad);
  padding: 4px;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 200;
}
.nav-dd.open .nav-dd-menu { display: block; }
.nav-dd-item {
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  color: #cbd5e1;
  border-radius: var(--rad-sm);
  transition: background var(--transition);
}
.nav-dd-item:hover { background: rgba(255,255,255,.06); color: #f1f5f9; }
.nav-dd-item.active { color: var(--nav-active); }

/* ── MAIN CONTENT ────────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  padding: 16px;
  margin-top:8px;
  max-width: 1280px;
  width: 100%;

}

/* ── SECTION / PAGE HEADERS ─────────────────────────────────── */
.page-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.page-hdr h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.page-hdr .sub {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 400;
}
.page-hdr-actions { display: flex; gap: 6px; align-items: center; }

/* ── CARD ────────────────────────────────────────────────────── */
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  box-shadow: var(--shadow);
}
.dash-card-bd { padding: 12px; }
.dash-card-bd-sm { padding: 8px 12px; }
.dash-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.dash-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

/* ── TABLE ───────────────────────────────────────────────────── */
.tbl {
  width: 100%;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--rad);
  overflow: hidden;
}
.tbl th {
  background: #f8fafc;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-2);
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td {
  padding: 6px 10px;
  border-bottom: 1px solid #f0f2f5;
  color: var(--text);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f8fafc; }
.tbl-sm td, .tbl-sm th { padding: 4px 8px; font-size: 11px; }

/* ── FORM ────────────────────────────────────────────────────── */
.frm { display: flex; flex-direction: column; gap: 8px; }
.frm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.frm-grp { display: flex; flex-direction: column; gap: 2px; }
.frm-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.frm-inp,
.frm-sel,
.frm-txt {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--rad-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.frm-inp:focus,
.frm-sel:focus,
.frm-txt:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-ring);
}
.frm-txt { padding: 6px 8px; height: auto; min-height: 60px; resize: vertical; }
.frm-inv { height: 32px; padding: 0 8px; border: 0; background: transparent; color: var(--text-2); font-size: 13px; }
.frm-inv:focus { outline: none; color: var(--text); }

/* ── BUTTON ──────────────────────────────────────────────────── */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--rad-sm);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  user-select: none;
}
.dash-btn:hover { box-shadow: var(--shadow); }
.dash-btn:active { transform: scale(.97); }
.dash-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.dash-btn-primary:hover { background: var(--primary-hv); border-color: var(--primary-hv); }
.dash-btn-secondary {
  background: #f1f5f9;
  color: var(--text-2);
  border-color: var(--border);
}
.dash-btn-secondary:hover { background: #e2e8f0; color: var(--text); }
.dash-btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.dash-btn-outline:hover { background: var(--primary-bg); }
.dash-btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.dash-btn-danger:hover { background: #b91c1c; }
.dash-btn-warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.dash-btn-warn:hover { background: #b45309; }
.dash-btn-sm { height: 24px; padding: 0 8px; font-size: 11px; }
.dash-btn-lg { height: 36px; padding: 0 18px; font-size: 13px; }
.dash-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── BADGE ───────────────────────────────────────────────────── */
.dash-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.4;
}
.dash-badge-green { background: var(--primary-bg); color: var(--primary); }
.dash-badge-yellow { background: var(--warn-bg); color: var(--warn); }
.dash-badge-red { background: var(--danger-bg); color: var(--danger); }
.dash-badge-blue { background: var(--info-bg); color: var(--info); }
.dash-badge-gray { background: #f1f5f9; color: var(--text-2); }
.dash-badge-hijau { background: #ecfdf5; color: var(--hijau); }
.dash-badge-kuning { background: #fef9e7; color: var(--kuning); }
.dash-badge-merah { background: #fef2f2; color: var(--merah); }

.bg-hijau { background-color: var(--hijau) !important; }
.bg-kuning { background-color: var(--kuning) !important; }
.bg-merah { background-color: var(--merah) !important; }
.bg-tertiary { background-color: var(--merah) !important; }
.text-hijau { color: var(--hijau) !important; }
.text-kuning { color: var(--kuning) !important; }
.text-biru { color: var(--biru) !important; }
.text-gold { color: var(--gold) !important; }
.text-merah { color: var(--merah) !important; }
.border-hijau { border-color: var(--hijau) !important; }
.border-kuning { border-color: var(--kuning) !important; }
.border-merah { border-color: var(--merah) !important; }

/* ── ALERT ───────────────────────────────────────────────────── */
.dash-alert {
  padding: 8px 12px;
  border-radius: var(--rad-sm);
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid transparent;
}
.dash-alert-success { background: var(--primary-bg); color: var(--primary); border-color: #a7f3d0; }
.dash-alert-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.dash-alert-warning { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.dash-alert-info { background: var(--info-bg); color: var(--info); border-color: #bfdbfe; }

/* ── MODAL / OVERLAY ─────────────────────────────────────────── */
.dash-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: fadeIn .15s ease;
}
.dash-modal {
  background: var(--surface);
  border-radius: var(--rad);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  min-width: 300px;
  max-width: 90vw;
  max-height: 85vh;
  overflow: auto;
}
.dash-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dash-modal-hdr h3 { font-size: 13px; font-weight: 600; }
.dash-modal-bd { padding: 14px; }
.dash-modal-close {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-3);
  border-radius: var(--rad-sm);
}
.dash-modal-close:hover { background: #f1f5f9; color: var(--text); }

/* ── TOAST ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toast {
  padding: 8px 14px;
  border-radius: var(--rad-sm);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  animation: toastIn .15s ease;
  transition: opacity .2s;
}
.toast-success { background: var(--primary); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }

/* ── WOWSLIDER ────────────────────────────────────────────────── */
#wowslider-container1 { margin: 0 auto 12px; width: 100%; }
#wowslider-container1 .ws_images img { border-radius: var(--rad); }
.ws-title { font-size: 13px !important; }
#wowslider-container1 .ws_playpause,
#wowslider-container1 .ws_next,
#wowslider-container1 .ws_prev { display: none !important; }

/* ── PRODUK GRID ─────────────────────────────────────────────── */
.produk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.produk-item {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 14px;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.produk-item:hover { border-color: var(--primary); box-shadow: var(--shadow-hv); }
.produk-item img { height: 48px; width: auto; margin: 0 auto 8px; }
.produk-item .nm { font-size: 13px; font-weight: 600; color: var(--text); }
.produk-item .desc { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* ── BERITA LIST ─────────────────────────────────────────────── */
.berita-list { display: flex; flex-direction: column; gap: 8px; }
.berita-item {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 10px;
  transition: border-color var(--transition);
}
.berita-item:hover { border-color: var(--border-hv); }
.berita-item img {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--rad-sm);
  flex-shrink: 0;
}
.berita-body { flex: 1; min-width: 0; }
.berita-body h3 { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.berita-meta { display: flex; gap: 6px; font-size: 10px; color: var(--text-3); margin-bottom: 4px; }
.berita-excerpt { font-size: 12px; color: var(--text-2); }

/* ── GALLERY GRID ────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.gallery-item {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--rad);
  overflow: hidden;
  transition: border-color var(--transition);
}
.gallery-item:hover { border-color: var(--primary); }
.gallery-item img { width: 100%; height: 140px; object-fit: cover; display: block; }

/* ── MAP ─────────────────────────────────────────────────────── */
.map-wrap { border: 1px solid var(--border); border-radius: var(--rad); overflow: hidden; }
.map-wrap iframe { width: 100%; height: 280px; display: block; }

/* ── DOCK (SUKU BUNGA) ──────────────────────────────────────── */
.dock { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad); margin-bottom: 12px; }
.dock-hdr {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-2);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.dock-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.dock-item {
  padding: 8px 12px;
  font-size: 12px;
  border-right: 1px solid var(--border);
}
.dock-item:last-child { border-right: none; }
.dock-item strong { font-size: 11px; color: var(--text-2); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }

/* ── FOOTER ──────────────────────────────────────────────────── */
.ftr {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 20px 16px 12px;
  font-size: 12px;
  margin-top: auto;
}
.ftr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
}
.ftr h4 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #e2e8f0; margin-bottom: 8px; }
.ftr p, .ftr li { line-height: 1.6; }
.ftr a { color: #64748b; }
.ftr a:hover { color: #e2e8f0; }
.ftr-divider { border: none; border-top: 1px solid rgba(255,255,255,.06); margin: 14px 0 10px; }
.ftr-btm {
  display: flex;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  font-size: 10px;
  color: #475569;
}

/* ── STEPPER (debitur flow) ──────────────────────────────────── */
.stepper {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--rad);
  overflow: hidden;
  background: var(--surface);
}
.stepper-item {
  flex: 1;
  text-align: center;
  padding: 7px 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  border-right: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.stepper-item:last-child { border-right: none; }
.stepper-item.active { background: var(--primary); color: #fff; }
.stepper-item.done { color: var(--primary); }

/* ── IKLAN POPUP ─────────────────────────────────────────────── */
.iklan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 600;
  cursor: pointer;
}
.iklan-overlay.show { display: flex; }
.iklan-overlay img { max-height: 90vh; max-width: 90vw; border-radius: var(--rad); }

/* ── WHATSAPP FLOAT ──────────────────────────────────────────── */
.wa-float {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  z-index: 50;
  background: #25d366;
  transition: transform var(--transition);
}
.wa-float:hover { transform: scale(1.1); }
.wa-float img { width: 22px; height: 22px; }

/* ── SKELETON LOADING ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f2f5 25%, #e4e7ed 50%, #f0f2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1s ease infinite;
  border-radius: var(--rad-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.htmx-swapping .main-wrap { opacity: 0; }
#main-content.htmx-added { animation: fadeIn .12s ease; padding: 5px;}

/* ── MOBILE NAVBAR ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: #fff !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 10px 16px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 1000;
  }
  .navbar-collapse .navbar-nav { gap: 4px; }
  .navbar .dropdown-menu {
    background: #f8f9fa !important;
    border: none !important;
    box-shadow: none !important;
    padding-left: 12px !important;
  }
  .navbar .dropdown-item { color: #333 !important; padding: 6px 12px !important; }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .topnav { padding: 0 8px; overflow-x: auto; }
  .topnav .nav-link { padding: 6px 8px; font-size: 11px; }
  .topnav-brand { margin-right: 8px; padding-right: 8px; }
  .main-wrap { padding: 10px; }
  .produk-grid { grid-template-columns: 1fr; }
  .frm-row { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .ftr-grid { grid-template-columns: 1fr 1fr; }
  .navbar-toggler { margin-right: -20px !important; margin-top: -15px !important; }
  .navbar-brand { margin-left: -30px !important; margin-top: -10px !important; }
  .navbar .dropdown-menu { background: #fff !important; margin-top: -4px !important; }
  .navbar .dropdown-item { color: #333 !important; }
  .dock-grid { grid-template-columns: 1fr; }
  #wowslider-container1 { width:90%;top:10px; }
  .dock-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stepper { flex-wrap: wrap; }
  .stepper-item { flex: auto; min-width: 80px; }
}

.suku-sidebar {
  position: sticky;
  top: 60px;
}
.row.g-4 > .col-lg-9 { padding-left: 5px; padding-right: 5px; }
.suku-sidebar .suku-card {
  font-size: .9rem;
  line-height: 1.6;
  min-height: 200px;
}
.suku-sidebar .owl-dot.active span {
  background: var(--hijau);
}

/* ── NEWS SLIDER ───────────────────────────────────────────── */
.news-slider {
  position: relative;
  overflow: hidden;
}
.news-track {
  display: flex;
  transition: transform .5s ease;
  gap: 16px;
}
.news-card {
  flex: 0 0 calc((100% - 32px) / 3);
  min-width: 0;
}
.news-card .card-inner {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, border-color .2s;
}
.news-card a:hover .card-inner {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(5,150,105,.15);
}
.news-card h6 {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #091E3E;
}
.news-card p {
  font-size: .82rem;
  color: #6b7280;
  flex: 1;
}
.news-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.news-nav button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background .15s, border-color .15s;
}
.news-nav button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
@media (max-width: 768px) {
  .news-card { flex: 0 0 100%; }
}
@media (min-width: 769px) and (max-width: 991px) {
  .news-card { flex: 0 0 calc((100% - 16px) / 2); }
}
