/* =========================================================
   SIG TATA RUANG — Design tokens
   Tema: "Meja Gambar Surveyor" — kertas kalkir, tinta navy,
   aksen amber topografi, garis grid seperti peta kontur.
   ========================================================= */

:root {
  --ink-navy: #0F1B2D;
  --ink-navy-2: #16273E;
  --paper: #F6F4EE;
  --paper-dim: #EDEAE0;
  --paper-line: #DDD7C6;
  --amber: #C77A3E;
  --amber-dark: #A8632E;
  --teal: #2D6A6A;
  --slate: #3E5C76;
  --red: #B4423A;
  --ink-text: #1C2430;
  --ink-muted: #6B7280;
  --white: #FFFFFF;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(15,27,45,.08);
  --shadow-md: 0 6px 24px rgba(15,27,45,.12);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sidebar-w: 264px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; max-width: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    linear-gradient(var(--paper-line) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px) 0 0/40px 40px,
    var(--paper);
  background-attachment: fixed;
  color: var(--ink-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

h1, h2, h3, h4, .brand, .card-title { font-family: var(--font-display); letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--paper-line); border-radius: 4px; }

/* ---------------- Layout shell ---------------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--ink-navy);
  color: #C9D2DE;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  background-image: linear-gradient(160deg, var(--ink-navy) 0%, var(--ink-navy-2) 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .mark {
  width: 34px; height: 34px;
  border: 2px solid var(--amber);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
}
.sidebar-brand .mark::before, .sidebar-brand .mark::after {
  content: ''; position: absolute; background: var(--amber);
}
.sidebar-brand .mark::before { width: 100%; height: 1.5px; top: 50%; left: 0; transform: translateY(-50%); }
.sidebar-brand .mark::after { height: 100%; width: 1.5px; left: 50%; top: 0; transform: translateX(-50%); }
.sidebar-brand .brand { color: #fff; font-size: 16px; line-height: 1.2; }
.sidebar-brand small { display: block; color: #8A96A8; font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

.nav-section { padding: 14px 12px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #63708A; padding: 14px 10px 6px; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: #B7C0CE;
  margin-bottom: 2px; transition: background .15s, color .15s;
  position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(199,122,62,.16); color: var(--amber); }
.nav-link.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--amber); border-radius: 0 3px 3px 0;
}
.nav-link .ic { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-user {
  padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12.5px; color: #8A96A8;
}
.sidebar-user b { color: #E4E8EE; font-weight: 600; display: block; font-size: 13.5px; }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--paper-line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 60;
}
.topbar .crumb { font-size: 13px; color: var(--ink-muted); }
.topbar .crumb b { color: var(--ink-text); font-weight: 600; }
.hamburger {
  display: none;
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--paper-line);
  background: var(--white); align-items: center; justify-content: center; cursor: pointer;
}
.topbar-spacer { flex: 1; }
.topbar-clock { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); display: none; }

.content { padding: 22px; flex: 1; }

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15,27,45,.5); z-index: 90;
}

/* ---------------- Components ---------------- */

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
/* signature: survey registration-mark corners */
.card.marked::before, .card.marked::after,
.card.marked .tick-br, .card.marked .tick-bl { display: none; }
.card.marked { padding: 20px 18px 18px; }
.card.marked::before {
  content: '';
  position: absolute; top: 8px; left: 8px; width: 10px; height: 10px;
  border-top: 1.5px solid var(--amber); border-left: 1.5px solid var(--amber);
  display: block;
}
.card.marked::after {
  content: '';
  position: absolute; bottom: 8px; right: 8px; width: 10px; height: 10px;
  border-bottom: 1.5px solid var(--amber); border-right: 1.5px solid var(--amber);
  display: block;
}

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); font-weight: 600; }
.stat-card .value { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--ink-navy); }
.stat-card .sub { font-size: 12px; color: var(--ink-muted); }
.stat-card .value.amber { color: var(--amber-dark); }
.stat-card .value.teal { color: var(--teal); }
.stat-card .value.red { color: var(--red); }

.card-title { font-size: 15.5px; font-weight: 600; margin: 0 0 4px; color: var(--ink-navy); }
.card-desc { font-size: 12.5px; color: var(--ink-muted); margin: 0 0 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  transition: transform .12s, box-shadow .12s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink-navy); color: #fff; }
.btn-primary:hover { background: var(--ink-navy-2); }
.btn-amber { background: var(--amber); color: #fff; }
.btn-amber:hover { background: var(--amber-dark); }
.btn-outline { background: transparent; border: 1px solid var(--paper-line); color: var(--ink-text); }
.btn-outline:hover { border-color: var(--ink-navy); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
}
.badge-teal { background: rgba(45,106,106,.12); color: var(--teal); }
.badge-amber { background: rgba(199,122,62,.14); color: var(--amber-dark); }
.badge-red { background: rgba(180,66,58,.12); color: var(--red); }
.badge-slate { background: rgba(62,92,118,.12); color: var(--slate); }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-navy); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--paper-line); border-radius: 8px;
  font-family: var(--font-body); font-size: 14px; background: var(--white); color: var(--ink-text);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(199,122,62,.15); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11.5px; color: var(--ink-muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); font-weight: 600; padding: 10px 12px; border-bottom: 2px solid var(--paper-dim); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--paper-dim); vertical-align: middle; }
tr:hover td { background: var(--paper-dim); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--paper-line); background: #fff; }
.table-wrap table { min-width: 640px; }

.coord-readout {
  position: relative; margin-top: 10px; border-radius: var(--radius);
  background: var(--ink-navy); color: #B7C0CE; font-family: var(--font-mono); font-size: 12px;
  padding: 9px 18px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
}
.coord-readout span b { color: var(--amber); font-weight: 600; }

.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--paper-line); box-shadow: var(--shadow-md); }
#map { width: 100%; }

/* Saat html2canvas mengambil gambar peta untuk fitur Cetak Peta, kontrol UI
   disembunyikan sementara agar hasil capture bersih (hanya peta & data). */
.map-wrap.print-capturing .leaflet-control-container,
.map-wrap.print-capturing .layer-panel,
.map-wrap.print-capturing .legend-panel,
.map-wrap.print-capturing #northArrow { display: none !important; }

.layer-panel {
  position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.97);
  border: 1px solid var(--paper-line); border-radius: 8px; padding: 12px 14px; z-index: 500;
  max-width: 220px; box-shadow: var(--shadow-md); max-height: 70%; overflow-y: auto;
}
.layer-panel h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.layer-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.layer-row .swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

.legend-panel {
  position: absolute; bottom: 12px; left: 12px; background: rgba(255,255,255,.97);
  border: 1px solid var(--paper-line); border-radius: 8px; padding: 10px 14px; z-index: 500;
  font-size: 12px; max-width: 200px; box-shadow: var(--shadow-md);
}

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 180px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0 0 4px; color: var(--ink-navy); }
.page-head p { margin: 0; color: var(--ink-muted); font-size: 13.5px; }

.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: rgba(45,106,106,.1); color: var(--teal); border: 1px solid rgba(45,106,106,.25); }
.alert-error { background: rgba(180,66,58,.1); color: var(--red); border: 1px solid rgba(180,66,58,.25); }
.alert-info { background: rgba(62,92,118,.1); color: var(--slate); border: 1px solid rgba(62,92,118,.25); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-muted); }
.empty-state .ic { width: 46px; height: 46px; margin: 0 auto 14px; opacity: .4; }

.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    linear-gradient(var(--paper-line) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px) 0 0/40px 40px,
    var(--paper);
}
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; border: 1px solid var(--paper-line); box-shadow: var(--shadow-md); padding: 34px 30px; }
.login-mark { width: 52px; height: 52px; border: 2.5px solid var(--amber); border-radius: 6px; position: relative; margin: 0 auto 18px; }
.login-mark::before, .login-mark::after { content: ''; position: absolute; background: var(--amber); }
.login-mark::before { width: 100%; height: 2px; top: 50%; left: 0; transform: translateY(-50%); }
.login-mark::after { height: 100%; width: 2px; left: 50%; top: 0; transform: translateX(-50%); }
.login-card h1 { text-align: center; font-size: 19px; margin: 0 0 2px; }
.login-card p.sub { text-align: center; color: var(--ink-muted); font-size: 12.5px; margin: 0 0 26px; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-sesuai { background: var(--teal); }
.dot-tidak { background: var(--red); }
.dot-syarat { background: var(--amber); }

/* ---------------- Responsive ---------------- */

@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar-backdrop.show { display: block; }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .topbar-clock { display: inline; }
}

/* =========================================================
   TAMPILAN APLIKASI MOBILE (native-app style)
   Berlaku HANYA di layar <=900px (HP & tablet potret).
   Desktop TIDAK terpengaruh sama sekali oleh section ini —
   semua aturan berikut ada di dalam @media (max-width:900px).
   ========================================================= */

.mobile-only { display: none; }

@media (max-width: 900px) {
  /* Sembunyikan shell desktop (sidebar+topbar lama), pindah ke shell app-style */
  .sidebar, .sidebar-backdrop, .topbar { display: none !important; }
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }
  .main { margin-left: 0; }
  .content { padding: 14px 14px 90px; } /* padding-bottom kasih ruang buat bottom nav */

  /* ---- Top bar mobile: judul halaman + lonceng notifikasi saja ---- */
  .m-topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; background: var(--white);
    border-bottom: 1px solid var(--paper-line);
    position: sticky; top: 0; z-index: 90;
  }
  .m-topbar .m-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--ink-navy); flex: 1; }
  .m-topbar .m-icon-btn {
    width: 38px; height: 38px; border-radius: 10px; background: var(--paper-dim);
    display: flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0;
  }

  /* ---- Bottom tab navigation ---- */
  .mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
    display: flex; background: var(--white); border-top: 1px solid var(--paper-line);
    box-shadow: 0 -4px 16px rgba(15,27,45,.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mobile-bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 9px 4px 8px; color: var(--ink-muted); font-size: 10.5px; font-weight: 600;
  }
  .mobile-bottom-nav a svg { width: 21px; height: 21px; }
  .mobile-bottom-nav a.active { color: var(--amber-dark); }
  .mobile-bottom-nav a.active .m-nav-ic { background: rgba(199,122,62,.14); border-radius: 10px; }
  .m-nav-ic { padding: 3px 14px; }

  /* ---- Kartu sambutan gradient (Beranda) ---- */
  .m-welcome-card {
    background: var(--ink-navy); background-image: linear-gradient(135deg, var(--ink-navy) 0%, var(--ink-navy-2) 60%, var(--amber-dark) 130%);
    border-radius: 16px; padding: 18px 20px; color: #fff; margin-bottom: 16px;
    display: flex; align-items: center; gap: 14px;
  }
  .m-welcome-card .m-avatar {
    width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
    font-weight: 700; font-size: 17px; flex-shrink: 0; border: 1.5px solid rgba(255,255,255,.3);
  }
  .m-welcome-card .m-greet { font-size: 11.5px; color: #C9D2DE; margin-bottom: 2px; }
  .m-welcome-card .m-name { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; }
  .m-welcome-card .m-role { font-size: 11.5px; color: #C9D2DE; margin-top: 1px; }

  /* ---- Grid statistik 2x2 ---- */
  .m-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .m-stat-card {
    background: var(--white); border: 1px solid var(--paper-line); border-radius: 14px;
    padding: 14px; box-shadow: var(--shadow-sm);
  }
  .m-stat-card .m-stat-ic {
    width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    margin-bottom: 8px;
  }
  .m-stat-card .m-stat-val { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--ink-navy); line-height: 1; }
  .m-stat-card .m-stat-label { font-size: 11px; color: var(--ink-muted); margin-top: 4px; }

  /* ---- Section umum ---- */
  .m-section-title { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
  .m-section-title h3 { font-family: var(--font-display); font-size: 14.5px; font-weight: 700; color: var(--ink-navy); margin: 0; }
  .m-section-title a { font-size: 12px; color: var(--amber-dark); font-weight: 600; }

  /* ---- Kartu preview peta ---- */
  .m-map-preview {
    position: relative; height: 130px; border-radius: 14px; overflow: hidden; margin-bottom: 18px;
    background: var(--paper-dim); border: 1px solid var(--paper-line);
    background-image:
      linear-gradient(var(--paper-line) 1px, transparent 1px), linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
    background-size: 22px 22px;
  }
  .m-map-preview .m-zone-a { position: absolute; left: 14%; top: 22%; width: 30%; height: 34%; background: rgba(45,106,106,.5); border: 1.5px solid var(--teal); border-radius: 4px; }
  .m-map-preview .m-zone-b { position: absolute; left: 48%; top: 40%; width: 34%; height: 40%; background: rgba(199,122,62,.5); border: 1.5px solid var(--amber); border-radius: 4px; }
  .m-map-preview .m-pin {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: 30px; height: 30px; background: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
  }
  .m-map-preview .m-preview-label {
    position: absolute; left: 12px; bottom: 10px; background: rgba(15,27,45,.85); color: #fff;
    font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 20px;
  }

  /* ---- List item info ---- */
  .m-info-list { background: var(--white); border: 1px solid var(--paper-line); border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
  .m-info-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--paper-dim); }
  .m-info-item:last-child { border-bottom: none; }
  .m-info-item .m-info-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .m-info-item .m-info-title { font-size: 13px; font-weight: 600; color: var(--ink-navy); }
  .m-info-item .m-info-sub { font-size: 11px; color: var(--ink-muted); margin-top: 1px; }

  /* ---- Halaman Login mobile (hero navy) ---- */
  .m-login-shell { min-height: 100vh; background: var(--ink-navy); background-image: linear-gradient(160deg, var(--ink-navy) 0%, var(--ink-navy-2) 100%); display: flex; flex-direction: column; }
  .m-login-hero { padding: 56px 28px 28px; text-align: center; }
  .m-login-hero .m-logo-circle {
    width: 76px; height: 76px; border-radius: 20px; background: var(--amber); background-image: linear-gradient(140deg, var(--amber) 0%, var(--amber-dark) 100%);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; box-shadow: 0 8px 24px rgba(199,122,62,.35);
  }
  .m-login-hero h1 { font-family: var(--font-display); color: #fff; font-size: 20px; margin: 0 0 4px; letter-spacing: .02em; }
  .m-login-hero p { color: #A8B0BC; font-size: 12.5px; margin: 0; line-height: 1.5; }
  .m-login-sheet { background: var(--white); border-radius: 26px 26px 0 0; padding: 28px 24px 34px; flex: 1; }
  .m-login-sheet .form-label { color: var(--ink-navy); }
  .m-login-sheet .form-control { background: var(--paper); border-color: var(--paper-line); padding: 13px 14px; }
  .m-login-remember { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 18px; font-size: 12.5px; color: var(--ink-muted); }
  .m-login-remember a { color: var(--amber-dark); font-weight: 600; }

  /* ---- Halaman Akun mobile ---- */
  .m-akun-hero { text-align: center; padding: 10px 0 20px; }
  .m-akun-hero .m-avatar-lg {
    width: 74px; height: 74px; border-radius: 50%; background: var(--ink-navy); background-image: linear-gradient(140deg, var(--ink-navy) 0%, var(--amber-dark) 140%);
    color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 24px; font-weight: 700;
    margin: 0 auto 12px; border: 3px solid var(--white); box-shadow: var(--shadow-md);
  }
  .m-akun-hero .m-akun-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--ink-navy); }
  .m-akun-hero .m-akun-role { display: inline-block; margin-top: 6px; }
  .m-menu-list { background: var(--white); border: 1px solid var(--paper-line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
  .m-menu-item {
    display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--paper-dim);
  }
  .m-menu-item:last-child { border-bottom: none; }
  .m-menu-item .m-menu-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--paper-dim); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .m-menu-item .m-menu-text { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--ink-navy); }
  .m-menu-item .m-menu-chevron { color: var(--ink-muted); }

  /* ---- Floating action buttons di atas peta (mobile) ---- */
  .m-map-fab-group { position: absolute; right: 12px; bottom: 12px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
  .m-map-fab {
    width: 42px; height: 42px; border-radius: 50%; background: var(--white); border: 1px solid var(--paper-line);
    display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); color: var(--ink-navy);
  }

  /* ---- Peta Interaktif mobile: search bar + panel layer jadi bottom-sheet ---- */
  .m-map-search { position: relative; margin-bottom: 12px; }
  .m-map-search input {
    width: 100%; padding: 12px 14px 12px 40px; border-radius: 12px; border: 1px solid var(--paper-line);
    background: var(--white); font-size: 13.5px; font-family: var(--font-body);
  }
  .m-map-search .m-search-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }

  .map-wrap { border-radius: 16px; }
  #map { height: calc(100vh - 300px) !important; min-height: 360px !important; }

  .layer-panel {
    left: 12px; right: 12px; top: auto; bottom: 12px; max-width: none;
    border-radius: 16px 16px 0 0; padding: 14px 16px;
  }
  .legend-panel { display: none; } /* diganti daftar legenda ringkas di bawah kartu peta pada mobile */
}

@media (max-width: 380px) {
  .m-stat-card .m-stat-val { font-size: 18px; }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .page-head h1 { font-size: 19px; }
  .card { padding: 15px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-clock { display: none; }
  .layer-panel { max-width: 46vw; padding: 10px; font-size: 12px; }
  .legend-panel { max-width: 44vw; padding: 8px 10px; font-size: 11px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .btn { width: 100%; }
  table { font-size: 12.5px; }
  .coord-readout { font-size: 10.5px; padding: 6px 10px; gap: 12px; overflow-x: auto; white-space: nowrap; margin-top: 8px; }
  .login-card { padding: 26px 20px; }
}

/* print (surat rekomendasi) */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .print-sheet { box-shadow: none; border: none; margin: 0; padding: 0; }
}
