/*!
 * SILAKES UI — lapisan tampilan responsif (offline, tanpa CDN).
 * Dimuat SETELAH bootstrap.min.css dan gaya bawaan layout, SEBELUM @stack('styles') halaman.
 * Hanya mengatur tampilan: tidak ada perubahan fungsi, rute, atau formulir.
 */

/* ───────────── 1. Token & dasar ───────────── */
:root {
  --ui-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --ui-bg: #f1f5f9;
  --ui-surface: #ffffff;
  --ui-line: #e2e8f0;
  --ui-line-soft: #eef2f6;
  --ui-ink: #0f172a;
  --ui-ink-2: #334155;
  --ui-mute: #64748b;
  --ui-radius: 14px;
  --ui-radius-sm: 10px;
  --ui-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --ui-shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
  --ui-focus: 0 0 0 .2rem rgba(37, 99, 235, .18);
  --bs-body-font-family: var(--ui-font);
  --bs-border-color: var(--ui-line);
  --bs-border-radius: .55rem;
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body { font-family: var(--ui-font); color: var(--ui-ink); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, svg, video, canvas { max-width: 100%; }
canvas { height: auto; }
::selection { background: rgba(37, 99, 235, .18); }
:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ───────────── 2. Kerangka dashboard staf ───────────── */
body.ui-dash { background: var(--ui-bg); }
.ui-dash .sidebar { box-shadow: 1px 0 0 rgba(255, 255, 255, .02), 4px 0 24px rgba(2, 6, 23, .08); }
.ui-dash .sidebar .nav-link-item { margin: 1px 10px; padding: 9px 12px; border-radius: 10px; border-left: 0; transition: background .15s, color .15s; }
.ui-dash .sidebar .nav-link-item.active { background: linear-gradient(90deg, rgba(37, 99, 235, .28), rgba(37, 99, 235, .10)); box-shadow: inset 3px 0 0 #3b82f6; }
.ui-dash .sidebar .nav-section-label { padding: 18px 22px 6px; }
.ui-dash .sidebar-footer .nav-link-item { margin: 0 0 8px !important; }
.ui-dash .sidebar-brand .brand-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }

.ui-dash .topbar { padding: 12px 24px; gap: 12px; min-height: 64px; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: saturate(160%) blur(8px); backdrop-filter: saturate(160%) blur(8px); }
.ui-dash .topbar > div:first-child { min-width: 0; flex: 0 1 auto; }
.ui-dash .topbar .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; letter-spacing: -.1px; }
.ui-dash .topbar .user-chip { flex-shrink: 0; }
.ui-dash .topbar .user-chip .text-end > div:first-child { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-dash .sidebar-toggle-btn, .ui-dash .topbar-search-btn { width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--ui-line); background: #fff; font-size: 20px; padding: 0; color: var(--ui-ink-2); }
.ui-dash .topbar-search-btn { display: none; font-size: 17px; }
.ui-dash .content-area { width: 100%; max-width: 1680px; margin: 0 auto; }
.ui-dash .app-footer { line-height: 1.7; }

/* Latar gelap saat menu samping terbuka di ponsel/tablet */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 1029; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.sidebar-backdrop.show { opacity: 1; visibility: visible; }
body.sidebar-open { overflow: hidden; }

@media (max-width: 991.98px) {
  .ui-dash .sidebar { width: min(86vw, 300px); box-shadow: var(--ui-shadow-lg); }
  .ui-dash .sidebar:not(.show) { box-shadow: none; }
  .ui-dash .topbar { padding: 10px 16px; }
  .ui-dash .content-area { padding: 18px 16px; }
}
@media (max-width: 767.98px) {
  .ui-dash .topbar-search-btn { display: inline-flex; }
  .ui-dash .topbar { flex-wrap: wrap; column-gap: 8px; }
  .ui-dash .topbar > div:first-child { flex: 1 1 0; gap: 10px !important; }
  .ui-dash .topbar .page-title { font-size: 15px; }
  .ui-dash .topbar .user-chip { gap: 8px; }
  .ui-dash .topbar .user-chip form .btn { width: 40px; height: 40px; border-radius: 10px; }
  /* Pencarian pasien muncul sebagai baris penuh di bawah judul */
  .ui-dash .topbar-search.ui-open { display: block !important; order: 10; flex: 1 0 100%; max-width: none; margin: 4px 0 2px; }
  .ui-dash .topbar-search input { font-size: 16px; padding-top: 9px; padding-bottom: 9px; }
  .ui-dash .content-area { padding: 14px 12px 20px; }
  .ui-dash .app-footer { padding: 12px 16px; font-size: 11.5px; }
}

/* ───────────── 3. Kartu, panel & tipografi ───────────── */
.card { border-color: var(--ui-line); border-radius: var(--ui-radius); }
.card-soft { border: 1px solid var(--ui-line-soft) !important; border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); background: var(--ui-surface); }
.card > .card-header:first-child { border-radius: calc(var(--ui-radius) - 1px) calc(var(--ui-radius) - 1px) 0 0; }
.card-header { background: #fff; border-bottom-color: var(--ui-line-soft); font-weight: 600; }
.card-footer { background: #fafbfc; border-top-color: var(--ui-line-soft); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { letter-spacing: -.2px; }
.text-muted { color: var(--ui-mute) !important; }
hr { border-color: var(--ui-line); opacity: 1; }
.list-group-item { border-color: var(--ui-line-soft); }
@media (max-width: 575.98px) {
  .card-soft.p-4, .card.p-4 { padding: 1.1rem !important; }
  .card-body { padding: 1rem; }
  h4, .h4 { font-size: 1.2rem; }
  h5, .h5 { font-size: 1.08rem; }
}

/* Baris judul halaman + tombol: tombol turun ke bawah saat layar sempit, tidak saling tumpuk */
@media (max-width: 575.98px) {
  .content-area .d-flex.justify-content-between:not(.flex-nowrap):not(.ui-keep) { flex-wrap: wrap; row-gap: .5rem; }
  .content-area .d-flex.justify-content-between > .d-flex.gap-2:not(.flex-nowrap) { flex-wrap: wrap; }
}

/* ───────────── 4. Tabel ───────────── */
.table { --bs-table-hover-bg: #f8fafc; margin-bottom: 0; color: var(--ui-ink); }
.table > :not(caption) > * > * { padding: .7rem .75rem; border-bottom-color: var(--ui-line-soft); }
.table-sm > :not(caption) > * > * { padding: .45rem .55rem; }
.table > thead > tr > th, .table > thead.table-light > tr > th, .table-light > tr > th {
  background: #f8fafc; color: #475569; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  border-bottom: 1px solid var(--ui-line); white-space: nowrap; vertical-align: middle;
}
.table > tbody > tr:last-child > * { border-bottom-color: transparent; }
.table td .btn-sm, .table td .badge { white-space: nowrap; }
.table td.ui-money, .table th.ui-money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui-money { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Tombol aksi di kolom terakhir tetap satu baris (baris tabel tidak memanjang ke bawah) */
.table td:last-child > .d-flex.flex-wrap { flex-wrap: nowrap !important; }

/* Gulir horizontal yang jelas di layar sempit */
.table-responsive { -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.table-responsive.ui-scrollable { position: relative;
  background:
    linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left center / 28px 100% no-repeat local,
    linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, .14), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, .14), transparent) right center / 12px 100% no-repeat scroll;
}
.ui-scroll-hint { display: none; font-size: 11.5px; color: var(--ui-mute); padding: 6px 12px 0; }
.ui-scroll-hint i { margin-right: 4px; }
@media (max-width: 767.98px) {
  .table > :not(caption) > * > * { padding: .6rem .6rem; font-size: 13.5px; }
  .table td, .table th { vertical-align: middle; }
  .ui-scroll-hint.show { display: block; }
}

/* ───────────── 5. Formulir ───────────── */
.form-label { font-weight: 600; color: var(--ui-ink-2); font-size: 13.5px; margin-bottom: .35rem; }
.form-control, .form-select { border-color: #d6dde6; border-radius: var(--ui-radius-sm); }
.form-control:focus, .form-select:focus { border-color: #3b82f6; box-shadow: var(--ui-focus); }
.form-control-sm, .form-select-sm { border-radius: 8px; }
.form-control::placeholder { color: #94a3b8; opacity: 1; }
.form-text { color: var(--ui-mute); }
.input-group > .form-control, .input-group > .form-select { border-radius: var(--ui-radius-sm); }
.input-group-sm > .form-control, .input-group-sm > .form-select { border-radius: 8px; }
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-text { background: #f8fafc; border-color: #d6dde6; color: var(--ui-mute); }
.form-check-input { border-color: #b8c2cf; }
.form-check-input:focus { box-shadow: var(--ui-focus); }
.form-switch .form-check-input { cursor: pointer; }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: #dc2626; }
@media (max-width: 767.98px) {
  /* 16px mencegah iPhone memperbesar layar otomatis saat kolom isian disentuh */
  input.form-control, select.form-select, textarea.form-control,
  input.form-control-sm, select.form-select-sm { font-size: 16px; }
  .form-control, .form-select { min-height: 42px; }
  .form-control-sm, .form-select-sm { min-height: 38px; }
  textarea.form-control { min-height: 88px; }
}

/* ───────────── 6. Tombol, lencana, peringatan ───────────── */
.btn { border-radius: var(--ui-radius-sm); font-weight: 500; }
.btn-sm { border-radius: 8px; }
.btn-lg { border-radius: 12px; }
.btn:not(.btn-link):active { transform: translateY(1px); }
.btn-brand, .btn-primary { box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.btn-light { border-color: var(--ui-line); }
.btn-outline-secondary { border-color: #cbd5e1; color: #475569; }
.btn-outline-secondary:hover { background: #f1f5f9; border-color: #94a3b8; color: var(--ui-ink); }
.badge { font-weight: 600; letter-spacing: .2px; border-radius: 6px; }
.alert { border-radius: 12px; border-width: 1px; }
.alert .btn-close { padding: 1rem; }
.dropdown-menu { border-color: var(--ui-line); border-radius: 12px; box-shadow: var(--ui-shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; }
.nav-tabs { border-bottom-color: var(--ui-line); }
.nav-tabs .nav-link { border-radius: 10px 10px 0 0; color: var(--ui-mute); }
.nav-tabs .nav-link.active { color: var(--ui-ink); font-weight: 600; }
.nav-pills .nav-link { border-radius: 10px; }
@media (max-width: 767.98px) {
  .btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
  .btn-sm { min-height: 36px; min-width: 36px; }
  .btn-link, .btn-close, .dropdown-toggle-split { min-height: 0; }
  .table .btn-sm { min-height: 34px; min-width: 34px; }
  /* Tab yang banyak bisa digeser, tidak turun berantakan */
  .nav-tabs, .nav-pills.ui-scroll-x { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs .nav-link { white-space: nowrap; }
}

/* ───────────── 7. Modal, offcanvas, paginasi ───────────── */
.modal-content { border: 0; border-radius: 16px; box-shadow: var(--ui-shadow-lg); }
.modal-header { border-bottom-color: var(--ui-line-soft); }
.modal-footer { border-top-color: var(--ui-line-soft); }
@media (max-width: 575.98px) {
  .modal-dialog { margin: .75rem; }
  .modal-dialog-centered { min-height: calc(100% - 1.5rem); }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer > .btn { flex: 1 1 auto; }
}
.pagination { flex-wrap: wrap; gap: 4px; margin-bottom: 0; }
.pagination .page-link { border-radius: 8px !important; border-color: var(--ui-line); color: #334155; min-width: 36px; text-align: center; }
.pagination .page-item.active .page-link { background: #2563eb; border-color: #2563eb; color: #fff; }
nav[role="navigation"] p.small { margin-bottom: .5rem; }
@media (max-width: 575.98px) {
  nav[role="navigation"] .d-sm-flex { justify-content: center !important; }
  .pagination .page-link { padding: .4rem .6rem; }
}

/* ───────────── 8. Komponen dashboard (dx-*) ───────────── */
.dx-stat, .dx-panel { border-radius: var(--ui-radius) !important; }
@media (max-width: 575.98px) {
  .dx-hero { padding: 18px !important; }
  .dx-hero h4 { font-size: 18px !important; }
}

/* ───────────── 9. Halaman login staf & pasien ───────────── */
.ui-auth .auth-greet { color: #bfdbfe; }
.ui-auth .auth-subtitle { color: #cbd5e1; }
@media (max-width: 575.98px) {
  .ui-auth .auth-main { padding: 24px 16px; align-items: flex-start; }
  .ui-auth .auth-card .card-box { padding: 22px 18px; border-radius: 16px; }
  .ui-auth .auth-title { font-size: 21px; }
}
@media (min-width: 992px) and (max-height: 720px) {
  .ui-auth .auth-side { padding: 32px 40px; }
}
.ui-pguest .auth-card { width: 100%; }
@media (max-width: 575.98px) {
  .ui-pguest .container { padding-left: 14px; padding-right: 14px; }
  .ui-pguest .auth-card { padding: 30px 20px; border-radius: 20px; }
}

/* ───────────── 10. Aplikasi pasien ───────────── */
body.ui-patient { background: #e8eef6; }
.ui-patient .phone-shell { position: relative; }
.ui-patient .menu-card { transition: transform .15s, box-shadow .15s; }
.ui-patient .menu-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 23, 42, .10); }
.ui-patient .menu-card:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.ui-patient .tab-pill a { transition: background .15s, color .15s; }
@media (min-width: 768px) {
  body.ui-patient { background: radial-gradient(1200px 500px at 50% -120px, #c7d8f3 0%, rgba(199, 216, 243, 0) 70%), #e8eef6; padding: 24px 16px; }
  .ui-patient .phone-shell { max-width: 640px; min-height: calc(100vh - 48px); border-radius: 26px; overflow: hidden; box-shadow: 0 20px 50px rgba(15, 23, 42, .14); }
  .ui-patient .content-pad { padding: 22px 26px; }
  .ui-patient .gradient-header { padding: 28px 26px 22px; }
  .ui-patient #moreMenu, .ui-patient .offcanvas-bottom { max-width: 640px !important; margin: 0 auto; }
}
@media (min-width: 1200px) {
  .ui-patient .phone-shell { max-width: 720px; }
  .ui-patient #moreMenu, .ui-patient .offcanvas-bottom { max-width: 720px !important; }
}
html[data-theme="dark"] body.ui-patient { background: #020617 !important; }
html[data-theme="dark"] .ui-patient .table > thead > tr > th { background: #0f172a; color: #94a3b8; border-color: #334155; }
html[data-theme="dark"] .ui-patient .table { color: #e2e8f0; --bs-table-bg: transparent; --bs-table-hover-bg: #1e293b; }
html[data-theme="dark"] .ui-patient .table > :not(caption) > * > * { border-bottom-color: #334155; }
html[data-theme="dark"] .ui-patient .card-soft { border-color: #334155 !important; }
html[data-theme="dark"] .ui-patient .table-responsive.ui-scrollable { background: none; }

/* ───────────── 11. Cetak dari halaman dashboard ───────────── */
@media print {
  .ui-dash .sidebar, .ui-dash .topbar, .ui-dash .app-footer, .sidebar-backdrop, .ui-scroll-hint,
  .ui-dash .alert-dismissible .btn-close, .ui-dash .modal { display: none !important; }
  .ui-dash .main-wrapper { margin-left: 0 !important; }
  .ui-dash .content-area { padding: 0 !important; max-width: none; }
  body.ui-dash { background: #fff !important; }
  .card-soft, .card { box-shadow: none !important; border-color: #d1d5db !important; break-inside: avoid; }
  .table-responsive { overflow: visible !important; background: none !important; }
}

/* ───────────── 12. Nama pasien, layanan, jenis layanan & obat tampil KAPITAL ─────────────
 * Hanya tampilan di dashboard staf: data di database tidak berubah. Teks lain tetap huruf biasa. */
.ui-dash .ui-up { text-transform: uppercase; }

/* ───────────── 13. Navigasi HP staf (bar bawah + halaman Menu) ─────────────
 * Hanya < 992px. Di PC tidak tampil sama sekali (sidebar tetap seperti biasa). */
.m-tabbar, .m-menu { display: none; }
@media (max-width: 991.98px) {
  .ui-dash .main-wrapper { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .m-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1025;
    background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
    border-top: 1px solid var(--ui-line); box-shadow: 0 -6px 20px rgba(15, 23, 42, .06);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .m-tab {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 4px 2px; border: 0; background: transparent; color: #64748b; text-decoration: none; border-radius: 12px;
    font: inherit; -webkit-tap-highlight-color: transparent;
  }
  .m-tab-ic { position: relative; width: 44px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 19px; transition: background .15s; }
  .m-tab-lb { font-size: 10.5px; font-weight: 600; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .m-tab.active { color: #1d4ed8; }
  .m-tab.active .m-tab-ic { background: #dbeafe; }
  .m-tab:active .m-tab-ic { background: #e2e8f0; }
  .m-badge { position: absolute; top: -5px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; font-style: normal; }
  .m-dot { position: absolute; top: 1px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px #fff; }

  /* Halaman Menu (lembar dari bawah, hampir layar penuh) */
  .m-menu.offcanvas-bottom { display: flex; height: 92vh; height: 92dvh; border-radius: 22px 22px 0 0; border: 0; background: #f1f5f9; }
  .m-menu-head { padding: 8px 18px 14px; background: #fff; border-radius: 22px 22px 0 0; border-bottom: 1px solid var(--ui-line); }
  .m-grab { width: 42px; height: 5px; border-radius: 3px; background: #cbd5e1; margin: 2px auto 12px; }
  .m-avatar { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
  .m-name { font-weight: 700; font-size: 16px; color: var(--ui-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-role { font-size: 12.5px; color: var(--ui-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-menu-body { padding: 6px 14px calc(24px + env(safe-area-inset-bottom)); }
  .m-sec { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #64748b; margin: 16px 4px 8px; }
  .m-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; background: #fff; border-radius: 16px; padding: 12px 6px; box-shadow: var(--ui-shadow); }
  .m-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; color: var(--ui-ink-2); padding: 6px 2px; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
  .m-tile:active { background: #f1f5f9; }
  .m-tile.active .m-lb { color: #1d4ed8; font-weight: 700; }
  .m-tile.active .m-ic { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #93c5fd; }
  .m-tile.disabled { opacity: .45; }
  .m-ic { position: relative; width: 48px; height: 48px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 21px; }
  .m-lb { font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.25; word-break: break-word; }
  .t-blue { background: #dbeafe; color: #1d4ed8; } .t-green { background: #dcfce7; color: #15803d; }
  .t-amber { background: #fef3c7; color: #b45309; } .t-violet { background: #ede9fe; color: #6d28d9; }
  .t-rose { background: #ffe4e6; color: #be123c; } .t-teal { background: #ccfbf1; color: #0f766e; }
  .t-orange { background: #ffedd5; color: #c2410c; } .t-indigo { background: #e0e7ff; color: #4338ca; }
  .t-slate { background: #e2e8f0; color: #334155; }
  .m-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .m-mode { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; border-radius: 14px; background: #fff; color: var(--ui-ink-2); font-weight: 600; font-size: 14px; text-decoration: none; box-shadow: var(--ui-shadow); }
  .m-mode.active { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
  .m-mode .m-badge { top: -6px; right: -4px; }
  .m-list { background: #fff; border-radius: 16px; box-shadow: var(--ui-shadow); overflow: hidden; }
  .m-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: transparent; color: var(--ui-ink); text-decoration: none; font-size: 14.5px; text-align: left; border-bottom: 1px solid var(--ui-line-soft); }
  .m-row:last-child, form:last-child > .m-row { border-bottom: 0; }
  .m-row > i:first-child { font-size: 18px; width: 22px; text-align: center; color: #64748b; }
  .m-row.text-danger > i:first-child { color: #dc2626; }
  .m-row.m-note { font-size: 13px; color: var(--ui-mute); }
  .m-row[hidden], .m-note[hidden] { display: none; }
  .m-foot { text-align: center; color: #94a3b8; font-size: 11.5px; margin-top: 18px; }
  /* Footer lama tidak perlu di HP: tautannya sudah ada di halaman Menu */
  .ui-dash .app-footer { display: none; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  .m-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .m-modes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .m-menu.offcanvas-bottom { max-width: 720px; margin: 0 auto; }
}
@media (min-width: 992px) { .m-menu.show, .m-menu.showing { display: none !important; } }
/* Saat dibuka sebagai aplikasi terpasang (PWA): beri ruang status bar iPhone */
html.is-pwa .ui-dash .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
@media print { .m-tabbar, .m-menu { display: none !important; } }

/* ───────────── 14. Ajakan pasang aplikasi staf (HP) ───────────── */
.spwa-banner { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 1040; max-width: 480px; margin: 0 auto;
  background: #fff; color: #0f172a; border-radius: 18px; box-shadow: 0 18px 40px rgba(2, 6, 23, .28); border: 1px solid #e2e8f0; padding: 14px 14px 12px;
  transform: translateY(140%); opacity: 0; transition: transform .3s ease, opacity .3s ease; font-family: var(--ui-font); }
.spwa-banner.show { transform: none; opacity: 1; }
.spwa-banner.on-dash { bottom: calc(80px + env(safe-area-inset-bottom)); }
.spwa-row { display: flex; gap: 12px; align-items: flex-start; }
.spwa-icon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; box-shadow: 0 2px 6px rgba(15, 23, 42, .15); }
.spwa-text { flex: 1; min-width: 0; }
.spwa-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.spwa-sub { font-size: 13px; color: #475569; margin-top: 3px; line-height: 1.45; }
.spwa-key { display: inline-flex; align-items: center; gap: 3px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; padding: 0 5px; font-weight: 600; color: #0f172a; white-space: nowrap; }
.spwa-x { border: 0; background: transparent; color: #94a3b8; width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; margin: -4px -4px 0 0; }
.spwa-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.spwa-later { border: 0; background: transparent; color: #64748b; font-weight: 600; font-size: 14px; padding: 9px 12px; border-radius: 10px; }
.spwa-go { border: 0; background: #2563eb; color: #fff; font-weight: 700; font-size: 14px; padding: 9px 18px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; }
.spwa-banner [hidden] { display: none !important; }
@media (min-width: 992px) { .spwa-banner { display: none !important; } }
@media print { .spwa-banner { display: none !important; } }

/* ───────────── 15. Ikon pasang & panduan pasang aplikasi staf ───────────── */
.topbar-install-btn { position: relative; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
  border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; font-size: 18px; padding: 0; }
.topbar-install-btn[hidden], .spwa-pill[hidden] { display: none !important; }
.tib-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px #eff6ff; animation: spwaPulse 1.8s infinite; }
@keyframes spwaPulse { 0% { box-shadow: 0 0 0 2px #eff6ff, 0 0 0 2px rgba(239, 68, 68, .5); } 70% { box-shadow: 0 0 0 2px #eff6ff, 0 0 0 9px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 2px #eff6ff, 0 0 0 2px rgba(239, 68, 68, 0); } }
.spwa-pill { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 1035; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .16); color: #fff; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 999px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(2, 6, 23, .2); }
@media (min-width: 992px) { .topbar-install-btn, .spwa-pill, .spwa-guide { display: none !important; } }
.spwa-ghost { border: 1px solid #cbd5e1; background: #fff; color: #334155; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; }

body.spwa-lock { overflow: hidden; }
.spwa-guide { position: fixed; inset: 0; z-index: 1060; display: flex; align-items: flex-end; justify-content: center; font-family: var(--ui-font); color: #0f172a; }
.spwa-guide[hidden] { display: none; }
.spwa-guide-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); opacity: 0; transition: opacity .2s; }
.spwa-guide-panel { position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: #fff;
  border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .25s ease; padding-bottom: env(safe-area-inset-bottom); }
.spwa-guide.show .spwa-guide-backdrop { opacity: 1; }
.spwa-guide.show .spwa-guide-panel { transform: none; }
.spwa-guide-head { display: flex; gap: 12px; align-items: center; padding: 18px 18px 12px; }
.spwa-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 18px; padding: 4px; background: #f1f5f9; border-radius: 12px; }
.spwa-tab { border: 0; background: transparent; border-radius: 9px; padding: 9px 6px; font-weight: 600; font-size: 14px; color: #64748b; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.spwa-tab.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.spwa-guide-body { overflow-y: auto; padding: 14px 18px 8px; -webkit-overflow-scrolling: touch; }
.spwa-guide-foot { padding: 10px 18px 16px; border-top: 1px solid #eef2f6; }
.spwa-h { font-weight: 700; font-size: 13px; color: #475569; text-transform: uppercase; letter-spacing: .4px; margin: 14px 0 8px; }
.spwa-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.spwa-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.spwa-n { width: 26px; height: 26px; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.spwa-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; line-height: 1.5; }
.spwa-quick { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 14px; padding: 12px; margin-bottom: 4px; }
.spwa-quick[hidden] { display: none; }
