:root {
  --primary: #0F2A43;
  --accent: #1E88E5;
  --gold: #C9A227;
  --bg: #F6F8FB;
  --card: #FFFFFF;
  --border: #E6EAF0;
  --text: #0B1220;
  --muted: #667085;
  --radius: 14px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: Inter, Roboto, system-ui, -apple-system, Segoe UI, Arial;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: .2px;
}

.brand .logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #163a66);
  box-shadow: 0 10px 22px rgba(15, 42, 67, .18);
  position: relative;
}

.brand .logo:after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  border: 2px solid rgba(201, 162, 39, .9);
}

.brand .tag {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.shell {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 14px;
  padding: 14px;
  height: calc(100vh - 68px);
}


.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(15, 42, 67, .06);
}

.sidebar {
  padding: 14px;
  overflow: auto;
}

.section-title {
  font-size: 12px;
  letter-spacing: .35px;
  color: var(--muted);
  font-weight: 900;
  margin: 8px 0 10px;
  text-transform: uppercase;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  margin: 10px 0 6px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #fff;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(30, 136, 229, .65);
  box-shadow: 0 0 0 4px rgba(30, 136, 229, .12);
}

.field .hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inline>* {
  flex: 1
}

.btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 42, 67, .10)
}

.btn:active {
  transform: translateY(0px);
  box-shadow: none
}

.btn-primary {
  background: var(--primary);
  color: #fff
}

.btn-accent {
  background: var(--accent);
  color: var(--primary)
}

.btn-gold {
  background: var(--gold);
  color: #1b1401
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--primary)
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent)
}

.kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.kpi .k {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.kpi .k .v {
  font-size: 20px;
  font-weight: 950;
  color: var(--primary)
}

.kpi .k .l {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  margin-top: 2px
}

.map-wrap {
  position: relative;
  overflow: hidden;
}

#map {
  height: 100%;
  width: 100%;
  border-radius: var(--radius);
}

.map-info {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: var(--muted);
  min-width: 220px;
}

.map-info b {
  color: var(--text)
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 2000;
  background: rgba(15, 42, 67, .94);
  color: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .18);
  display: none;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.table th {
  background: #fbfcff;
  text-align: left;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .25px;
  text-transform: uppercase;
}

.table tr:last-child td {
  border-bottom: 0
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--border);
}

.badge.ok {
  background: #E8F5E9;
  color: #2E7D32;
  border-color: #C8E6C9
}

.badge.warn {
  background: #FFF3E0;
  color: #ED6C02;
  border-color: #FFE0B2
}

.badge.danger {
  background: #FFEBEE;
  color: #C62828;
  border-color: #FFCDD2
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
    height: auto
  }

  #map {
    height: 56vh
  }
}

/* ===== STANDARD MAP PIN (CLEAR & SHARP) ===== */
.marker {
  width: 26px;
  height: 26px;
  background: #0F2A43;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;

  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}

/* Titik tengah */
.marker::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  left: 6px;
}

/* ===== WARNA IKUT JENIS ASET ===== */
.marker.masjid {
  background: #b45309;
  /* amber */
}

.marker.bangunan {
  background: #1d4ed8;
  /* blue */
}

.marker.kubur {
  background: #6d28d9;
  /* purple */
}

.marker.baitulmal {
  background: #047857;
  /* green */
}




/* ===== RING IKUT POTENSI (ANALITIK) ===== */
.marker.potensi-high {
  /* hijau */
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .55), 0 4px 10px rgba(0, 0, 0, .35);
}

.marker.potensi-med {
  /* kuning */
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .55), 0 4px 10px rgba(0, 0, 0, .35);
}

.marker.potensi-low {
  /* merah */
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .55), 0 4px 10px rgba(0, 0, 0, .35);
}

/* ✅ Fix DivIcon wrapper supaya tak jadi kotak putih / tak zero-size */
.muip-pin {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* ✅ Pastikan marker betul-betul render */
.marker {
  display: block;
  /* penting */
}




/* ================================
   FIX: Leaflet DivIcon wrapper
   (elak kotak putih & elak marker hilang)
================================== */

/* 1) Jangan clip marker (pin ada ekor) */
.map-wrap {
  overflow: visible;
  /* ✅ penting: sebelum ni hidden */
}

/* 2) Buang style default leaflet div icon */
.leaflet-div-icon {
  background: transparent !important;
  border: 0 !important;
}

/* 3) Wrapper custom untuk divIcon */
.muip-pin {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  width: 26px !important;
  height: 26px !important;
  display: block !important;
}

/* ================================
   STANDARD MAP PIN (CLEAR & SHARP)
================================== */
.marker {
  width: 26px;
  height: 26px;
  background: #0F2A43;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;

  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);

  display: block;
  /* ✅ penting */
  pointer-events: auto;
}

/* Titik tengah */
.marker::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  left: 6px;
}

/* Warna ikut jenis */
.marker.masjid {
  background: #b45309;
}

.marker.bangunan {
  background: #1d4ed8;
}

.marker.kubur {
  background: #6d28d9;
}

.marker.baitulmal {
  background: #047857;
}

/* ===== Uniform Control Height (input/select) ===== */
:root {
  --control-h: 44px;
  /* ✅ semua control sama tinggi */
  --control-pad-x: 12px;
}

/* Semua input/select sama tinggi */
.field input,
.field select,
.field textarea {
  height: var(--control-h);
  padding: 0 var(--control-pad-x);
  line-height: calc(var(--control-h) - 2px);
}

/* textarea jangan dipaksa tinggi */
.field textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.35;
}

/* ===== SELECT: buang style default & buat arrow sendiri ===== */
.field select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  padding-right: 42px;
  /* ruang untuk arrow */
  background-color: #fff;

  /* arrow custom (SVG) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='%23667085' d='M7 10l5 5l5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
}

/* Untuk IE lama (kalau ada) */
.field select::-ms-expand {
  display: none;
}

/* Fokus sama macam input */
.field select:focus {
  border-color: rgba(30, 136, 229, .65);
  box-shadow: 0 0 0 4px rgba(30, 136, 229, .12);
}




/* =========================
       ✅ TOPBAR V3 (KEMAS + MENU DROPDOWN)
    ========================= */
.topbar-v3 {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(2, 6, 23, .08);
  padding: 10px 12px;

  display: grid;
  grid-template-columns: 1.15fr 1.7fr 1.15fr;
  gap: 10px;
  align-items: center;
}

.tb-left,
.tb-center,
.tb-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tb-center {
  justify-content: center;
}

.tb-right {
  justify-content: flex-end;
}

.brand {
  min-width: 0;
}

.brand .brand-text {
  min-width: 0;
}

.brand .brand-title {
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.brand .brand-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 6px;
  width: min(720px, 100%);
  min-width: 240px;
}

.tb-search input {
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  padding: 8px 10px !important;
  width: 100%;
  min-width: 140px;
  font-weight: 850;
}

/* dropdown menu */
.dd {
  position: relative;
}

.dd-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}

.dd-btn:hover {
  filter: brightness(.98);
}

.dd-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  background: #fff;
  border: 1px solid rgba(2, 6, 23, .10);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(2, 6, 23, .18);
  padding: 10px;
  display: none;
  z-index: 1200;
}

.dd.open .dd-panel {
  display: block;
}

.dd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.dd-user {
  font-weight: 950;
  color: #0B1220;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.dd-role {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-top: 2px;
}

.dd-sep {
  height: 1px;
  background: rgba(2, 6, 23, .08);
  margin: 8px 0;
}

.dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: #0B1220;
  font-weight: 900;
}

.dd-item:hover {
  background: #F7F9FC;
}

.dd-item .hint {
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
}

.dd-danger {
  color: #B42318;
}

.dd-item.dd-danger:hover {
  background: #FFF5F5;
}

.dd-mini {
  font-size: 11px;
  font-weight: 900;
  color: #667085;
  border: 1px solid rgba(2, 6, 23, .10);
  padding: 3px 8px;
  border-radius: 999px;
}

@media (max-width: 1100px) {
  .topbar-v3 {
    grid-template-columns: 1fr;
  }

  .tb-center {
    justify-content: flex-start;
  }

  .tb-right {
    justify-content: flex-start;
  }

  .tb-search {
    width: 100%;
  }

  .brand .brand-title {
    max-width: 100%;
  }

  .dd-panel {
    left: 0;
    right: auto;
    width: min(420px, 100%);
  }
}


/* =========================
   ✅ TOPBAR INDEX STYLE (KEMAS + MENU DROPDOWN)
========================= */
.topbar-v3 {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(2, 6, 23, .08);
  padding: 10px 12px;

  display: grid;
  grid-template-columns: 1.15fr 1.7fr 1.15fr;
  gap: 10px;
  align-items: center;
}

.tb-left,
.tb-center,
.tb-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tb-center {
  justify-content: center;
}

.tb-right {
  justify-content: flex-end;
}

/* ✅ brand ikut index (logo + teks) */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand .logo {
  flex: 0 0 auto;
}

.brand .brand-text {
  min-width: 0;
}

.brand .brand-title {
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.brand .brand-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ✅ semua control tinggi sama (38px) */
.btn-toggle,
.chip,
.dd-btn,
.tb-search,
.tb-search input,
.tb-search .btn {
  height: 38px;
}

.btn-toggle {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.btn-toggle:hover {
  filter: brightness(.98);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 950;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.chip input {
  width: 16px;
  height: 16px;
}

/* ✅ search bar */
.tb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 0 6px;
  width: min(720px, 100%);
  min-width: 240px;
}

.tb-search input {
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  padding: 0 10px !important;
  width: 100%;
  min-width: 140px;
  font-weight: 850;
}

.tb-search button {
  height: 30px;
  /* dalam bar 38px */
  padding: 0 10px;
  border-radius: 10px;
}

/* ✅ dropdown menu */
.dd {
  position: relative;
}

.dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}

.dd-btn:hover {
  filter: brightness(.98);
}

.dd-mini {
  font-size: 11px;
  font-weight: 900;
  color: #667085;
  border: 1px solid rgba(2, 6, 23, .10);
  padding: 3px 8px;
  border-radius: 999px;
}

.dd-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  background: #fff;
  border: 1px solid rgba(2, 6, 23, .10);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(2, 6, 23, .18);
  padding: 10px;
  display: none;
  z-index: 1200;
}

.dd.open .dd-panel {
  display: block;
}

.dd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.dd-user {
  font-weight: 950;
  color: #0B1220;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.dd-role {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-top: 2px;
}

.dd-sep {
  height: 1px;
  background: rgba(2, 6, 23, .08);
  margin: 8px 0;
}

.dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: #0B1220;
  font-weight: 900;
}

.dd-item:hover {
  background: #F7F9FC;
}

.dd-item .hint {
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
}

.dd-danger {
  color: #B42318;
}

.dd-item.dd-danger:hover {
  background: #FFF5F5;
}

.btn-mini {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 950;
  cursor: pointer;
  font-size: 12px;
  height: 34px;
  display: inline-flex;
  align-items: center;
}

/* responsive */
@media (max-width: 1100px) {
  .topbar-v3 {
    grid-template-columns: 1fr;
  }

  .tb-center {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .tb-right {
    justify-content: flex-start;
  }

  .tb-search {
    width: 100%;
  }

  .brand .brand-title {
    max-width: 100%;
  }

  .dd-panel {
    left: 0;
    right: auto;
    width: min(420px, 100%);
  }
}


/* =========================
   PREMIUM DROPDOWN MENU FIX
========================= */

/* Header user */
.dd-user {
  font-size: 15px;
  font-weight: 700;
  /* kurang kasar */
  letter-spacing: -.2px;
}

.dd-role {
  font-size: 11.5px;
  font-weight: 600;
  color: #667085;
}

/* Item menu utama */
.dd-item {
  padding: 12px 12px;
  /* lebih selesa */
  gap: 12px;
  align-items: center;
}

/* Text kiri (Dashboard, Senarai Aset, dll) */
.dd-item span:first-child {
  font-size: 14px;
  font-weight: 700;
  /* dari 900 → 700 */
  letter-spacing: -.2px;
}

/* Hint kanan */
.dd-item .hint {
  font-size: 12px;
  font-weight: 600;
  color: #667085;
  white-space: nowrap;
}

/* Hover lebih premium */
.dd-item:hover {
  background: linear-gradient(0deg,
      #F8FAFC,
      #F8FAFC);
}

/* Logout khas */
.dd-item.dd-danger {
  font-size: 14px;
  font-weight: 700;
}

/* Icon emoji – kecil & sejajar */
.dd-item span:first-child::before {
  font-size: 15px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Separator lebih halus */
.dd-sep {
  background: rgba(2, 6, 23, .06);
  margin: 10px 0;
}

/* Panel lebih premium */
.dd-panel {
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .18);
}


.logo-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(2, 6, 23, .08);
  padding: 4px;
}


/* =========================
           ✅ FIX MENU TEXT OVERFLOW (MOBILE)
        ========================= */
@media (max-width: 560px) {

  .dd-item {
    align-items: flex-start !important;
    gap: 10px;
  }

  .dd-item span:first-child {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal !important;
    /* ✅ benarkan wrap */
    word-break: break-word;
    line-height: 1.25;
  }

  .dd-item .hint {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-left: 6px;
    align-self: center;
    font-size: 11px;
  }

  /* bagi panel lebih ruang */
  .dd-panel {
    padding: 12px !important;
  }
}





/* grid gambar */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* card */
.img-card {
  border: 1px solid #e6eaf0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 42, 67, .06);
}

/* area thumbnail */
.img-thumb {
  width: 100%;
  height: 160px;
  /* boleh adjust 140–200 */
  background: #f6f8fb;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ✅ Ini yang penting: cover vs contain */
.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* cover = penuh cantik, crop sikit */
  /* object-fit: contain; */
  /* kalau nak logo penuh tanpa crop */
  display: block;
}

/* footer bawah (nama file + delete) */
.img-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
}

.img-name {
  font-weight: 900;
  color: #0b1220;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}


/* ===== Sweet-like Confirm (no library) ===== */
.swalx-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}

.swalx-backdrop.show {
  display: flex;
}

.swalx-card {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  overflow: hidden;
  text-align: center;
  transform: scale(.98);
  opacity: 0;
  transition: all .15s ease;
}

.swalx-backdrop.show .swalx-card {
  transform: scale(1);
  opacity: 1;
}

.swalx-body {
  padding: 34px 28px 24px;
}

.swalx-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  border: 6px solid #cfe0e8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9fb7c3;
  font-weight: 900;
  font-size: 46px;
  line-height: 1;
  user-select: none;
}

.swalx-title {
  margin: 0;
  font-size: 52px;
  font-weight: 800;
  color: #5a5a5a;
}

.swalx-msg {
  margin: 14px 0 0;
  font-size: 22px;
  color: #8a8a8a;
}

.swalx-actions {
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 18px 0 34px;
}

.swalx-btn {
  min-width: 160px;
  padding: 14px 22px;
  border: 0;
  border-radius: 6px;
  font-size: 22px;
  cursor: pointer;
  transition: transform .08s ease, opacity .12s ease;
}

.swalx-btn:active {
  transform: scale(.99);
}

.swalx-cancel {
  background: #bdbdbd;
  color: #fff;
}

.swalx-yes {
  background: #7fd0f2;
  color: #fff;
}

.swalx-btn[disabled] {
  opacity: .65;
  cursor: not-allowed;
}

/* optional: kecilkan sikit untuk mobile */
@media (max-width:520px) {
  .swalx-title {
    font-size: 34px;
  }

  .swalx-msg {
    font-size: 16px;
  }

  .swalx-btn {
    font-size: 18px;
    min-width: 130px;
  }
}


/* ===== Premium Confirm Modal (Responsive) ===== */
.muip-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.muip-modal {
  width: min(92vw, 520px);
  /* ✅ auto kecil: max 520 */
  max-height: 85vh;
  /* ✅ elak overflow */
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
  transform: translateY(6px);
  animation: muipPop .16s ease-out;
}

@keyframes muipPop {
  from {
    opacity: .0;
    transform: translateY(12px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(6px) scale(1);
  }
}

.muip-modal-inner {
  padding: 22px 22px 18px;
  text-align: center;
}

.muip-modal-icon {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 6px auto 10px;
  border: 3px solid rgba(70, 110, 140, .25);
  color: rgba(70, 110, 140, .85);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
}

.muip-modal-title {
  margin: 2px 0 6px;
  font-size: 28px;
  /* ✅ kecil dari sebelumnya */
  font-weight: 800;
  letter-spacing: .2px;
  color: #3a3a3a;
}

.muip-modal-msg {
  margin: 0 auto 16px;
  max-width: 38ch;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.45;
}

.muip-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 0 22px 22px;
}

.muip-btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  min-width: 128px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, opacity .08s ease, box-shadow .08s ease;
}

.muip-btn:active {
  transform: translateY(1px);
}

.muip-btn-cancel {
  background: #e5e7eb;
  color: #475569;
}

.muip-btn-yes {
  background: #7dd3fc;
  /* boleh tukar ikut tema MUIP */
  color: #0b2239;
  box-shadow: 0 10px 22px rgba(125, 211, 252, .35);
}

/* ✅ Responsive untuk phone */
@media (max-width: 420px) {
  .muip-modal {
    width: min(94vw, 420px);
    border-radius: 16px;
  }

  .muip-modal-title {
    font-size: 22px;
  }

  .muip-modal-inner {
    padding: 18px 16px 14px;
  }

  .muip-modal-actions {
    flex-direction: column;
    /* ✅ stack button bila sempit */
    padding: 0 16px 16px;
  }

  .muip-btn {
    width: 100%;
    min-width: 0;
  }
}


.dd-item .ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0F2A43, #2563EB);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}

.filter-form {
  margin-top: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr 0.9fr 0.8fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.field-q {
  min-width: 280px;
}

.field-actions {
  justify-self: end;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Tablet */
@media (max-width: 1200px) {
  .filter-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .field-actions {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .actions {
    justify-content: flex-start;
  }
}

/* Mobile */
@media (max-width: 700px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .field-actions {
    justify-self: stretch;
  }

  .actions {
    justify-content: stretch;
  }

  .actions .btn {
    width: 100%;
  }
}

/* ===== Loading overlay (filter) ===== */
.flt-loading{
  display:none;
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(6px);
  z-index: 10;
  align-items:center;
  justify-content:center;
}

.card.card-pad{ position: relative; } /* penting utk overlay ikut card */

.flt-loading.show{ display:flex; }

.flt-loading-inner{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(2,6,23,.12);
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 40px rgba(2,6,23,.12);
  font-weight: 950;
  font-size: 13px;
  color: #0B1220;
}

.spin{
  width:18px;height:18px;
  border-radius:999px;
  border:3px solid rgba(37,99,235,.20);
  border-top-color: rgba(37,99,235,.95);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* optional: loading bar kecil bawah text */
.flt-loading-inner::after{
  content:'';
  display:block;
  height:3px;
  width:140px;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(37,99,235,.15), rgba(37,99,235,.95), rgba(37,99,235,.15));
  animation: shimmer 1.1s ease-in-out infinite;
  margin-left: 6px;
}
@keyframes shimmer{
  0%{ transform: translateX(-20px); opacity:.6; }
  50%{ transform: translateX(20px); opacity:1; }
  100%{ transform: translateX(-20px); opacity:.6; }
}

/* ===== Loading overlay (filter) ===== */
.flt-loading {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(6px);
  z-index: 10;
  align-items: center;
  justify-content: center;
}

.card.card-pad {
  position: relative;
}

/* penting utk overlay ikut card */

.flt-loading.show {
  display: flex;
}

.flt-loading-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(2, 6, 23, .12);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 40px rgba(2, 6, 23, .12);
  font-weight: 950;
  font-size: 13px;
  color: #0B1220;
}

.spin {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid rgba(37, 99, 235, .20);
  border-top-color: rgba(37, 99, 235, .95);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* optional: loading bar kecil bawah text */
.flt-loading-inner::after {
  content: '';
  display: block;
  height: 3px;
  width: 140px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, .15), rgba(37, 99, 235, .95), rgba(37, 99, 235, .15));
  animation: shimmer 1.1s ease-in-out infinite;
  margin-left: 6px;
}

@keyframes shimmer {
  0% {
    transform: translateX(-20px);
    opacity: .6;
  }

  50% {
    transform: translateX(20px);
    opacity: 1;
  }

  100% {
    transform: translateX(-20px);
    opacity: .6;
  }
}