/* =====================================================================
   SPC Integration — Android App UI (Material Design 3, tema oranye SPC)
   Dirancang untuk Android WebView: selalu tata letak aplikasi mobile.
   ===================================================================== */
:root {
  /* Warna M3 dari seed oranye SPC */
  --md-primary: #F47B20;
  --md-primary-dark: #D9620B;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #FFDCC6;
  --md-on-primary-container: #311300;
  --md-secondary-container: #FFE2D1;
  --md-on-secondary-container: #2C160A;
  --md-surface: #FFF8F5;
  --md-surface-low: #FFF1EA;
  --md-surface-container: #FCEBE2;
  --md-surface-high: #F6E5DC;
  --md-card: #FFFFFF;
  --md-on-surface: #221A15;
  --md-on-surface-variant: #52443C;
  --md-outline: #85736A;
  --md-outline-variant: #E6D3C9;
  --md-inverse-surface: #382E29;
  --md-inverse-on-surface: #FFEDE5;
  --md-error: #BA1A1A; --md-error-container: #FFDAD6;
  --ok: #1E8E4E; --ok-container: #D3F5DD;
  --warn: #8A5A00; --warn-container: #FFE9B8;
  --info: #2E5AAC; --info-container: #DCE6FF;
  --grad: linear-gradient(135deg, #FF9A3D 0%, #F47B20 50%, #E2560B 100%);
  --elev-1: 0 1px 2px rgba(0,0,0,.18), 0 1px 3px 1px rgba(0,0,0,.08);
  --elev-2: 0 1px 2px rgba(0,0,0,.2), 0 2px 6px 2px rgba(0,0,0,.1);
  --elev-3: 0 4px 8px 3px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.2);
  --appbar-h: 64px;
  --navbar-h: 80px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --emph: cubic-bezier(.2,0,0,1);
  --decel: cubic-bezier(.05,.7,.1,1);

  --bs-primary: #F47B20; --bs-primary-rgb: 244,123,32;
  --bs-link-color: #C2550A; --bs-link-color-rgb: 194,85,10; --bs-link-hover-color: #C2550A;
  --bs-body-font-family: Roboto, "Google Sans", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-bg: var(--md-surface); --bs-body-color: var(--md-on-surface);
  --bs-border-color: var(--md-outline-variant);
  --bs-border-radius: 12px; --bs-border-radius-lg: 16px; --bs-border-radius-sm: 8px;
}

/* ---------- Dasar: rasa aplikasi native ---------- */
* { -webkit-tap-highlight-color: transparent; }
html, body { overscroll-behavior: none; }
body { background: var(--md-surface); color: var(--md-on-surface); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { text-decoration: none; }
a:hover { text-decoration: none; }
.appbar, .navbar-m3, .drawer, .btn, .chip, .tabbar, .fab, .m3-list a, .list-group-item-action { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; }
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6 { font-weight: 500; letter-spacing: 0; color: var(--md-on-surface); }
.h4, h1.h4 { font-size: 1.375rem; } .h5 { font-size: 1.125rem; } .h6 { font-size: 1rem; }
.text-muted { color: var(--md-on-surface-variant) !important; }
.small, small { font-size: .82rem; }
::selection { background: var(--md-primary-container); }
:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }

/* ---------- Tombol (M3) ---------- */
.btn { border-radius: 100px; font-weight: 500; letter-spacing: .01em; min-height: 44px; padding: .55rem 1.4rem; font-size: .92rem; position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; transition: box-shadow .2s, background-color .2s; box-shadow: none; }
.btn:hover { box-shadow: none; }
.btn-sm { min-height: 36px; padding: .3rem 1rem; font-size: .84rem; }
.btn-lg { min-height: 52px; font-size: 1rem; }
.btn i { font-size: 1.1em; }
.btn-primary { --bs-btn-bg: var(--md-primary); --bs-btn-border-color: var(--md-primary); --bs-btn-hover-bg: var(--md-primary); --bs-btn-hover-border-color: var(--md-primary); --bs-btn-active-bg: var(--md-primary-dark); --bs-btn-active-border-color: var(--md-primary-dark); --bs-btn-disabled-bg: #E9C2A6; --bs-btn-disabled-border-color: #E9C2A6; color: #fff; }
.btn-primary:active { box-shadow: var(--elev-1); }
.btn-outline-primary, .btn-outline-secondary { --bs-btn-color: var(--md-primary-dark); --bs-btn-border-color: var(--md-outline); --bs-btn-hover-bg: transparent; --bs-btn-hover-color: var(--md-primary-dark); --bs-btn-hover-border-color: var(--md-outline); --bs-btn-active-bg: rgba(244,123,32,.12); --bs-btn-active-color: var(--md-primary-dark); --bs-btn-active-border-color: var(--md-outline); background: transparent; }
.btn-outline-secondary { --bs-btn-color: var(--md-on-surface-variant); --bs-btn-hover-color: var(--md-on-surface-variant); }
.btn-outline-success { --bs-btn-color: var(--ok); --bs-btn-border-color: var(--md-outline); --bs-btn-hover-bg: transparent; --bs-btn-hover-color: var(--ok); --bs-btn-hover-border-color: var(--md-outline); }
.btn-outline-danger, .btn-outline-warning { --bs-btn-border-color: var(--md-outline); --bs-btn-hover-bg: transparent; --bs-btn-hover-border-color: var(--md-outline); }
.btn-outline-danger { --bs-btn-hover-color: var(--md-error); --bs-btn-color: var(--md-error); }
.btn-outline-warning { --bs-btn-color: #9A5B00; --bs-btn-hover-color: #9A5B00; }
.btn-success { --bs-btn-bg: var(--ok); --bs-btn-border-color: var(--ok); --bs-btn-hover-bg: var(--ok); --bs-btn-hover-border-color: var(--ok); }
.btn-warning { --bs-btn-bg: #FFB95C; --bs-btn-border-color: #FFB95C; --bs-btn-hover-bg: #FFB95C; --bs-btn-hover-border-color: #FFB95C; }
.btn-danger { --bs-btn-bg: var(--md-error); --bs-btn-border-color: var(--md-error); --bs-btn-hover-bg: var(--md-error); }
.btn-light, .btn-tonal { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border: 0; }
.btn-link { color: var(--md-primary-dark); }
.btn:disabled, .btn.disabled { opacity: .5; }

/* ---------- Text field (M3 outlined) ---------- */
.form-control, .form-select { border-radius: 8px; min-height: 56px; border: 1px solid var(--md-outline); background-color: transparent; padding: .9rem 1rem; font-size: 16px; color: var(--md-on-surface); transition: border-color .15s, box-shadow .15s; }
.form-control:focus, .form-select:focus { border-color: var(--md-primary); box-shadow: inset 0 0 0 1px var(--md-primary); background-color: transparent; }
.form-control::placeholder { color: #9C8B82; }
textarea.form-control { min-height: 100px; }
.form-control:disabled { background: rgba(34,26,21,.04); border-color: var(--md-outline-variant); }
.form-label { font-weight: 500; font-size: .82rem; color: var(--md-on-surface-variant); margin-bottom: .3rem; }
.form-text { color: var(--md-on-surface-variant); font-size: .76rem; margin-top: .3rem; }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: var(--md-error); box-shadow: inset 0 0 0 1px var(--md-error); background-image: none; }
.was-validated .form-control:valid { border-color: var(--md-outline); background-image: none; }
.invalid-feedback { color: var(--md-error); }
.form-check-input { width: 20px; height: 20px; border: 2px solid var(--md-on-surface-variant); border-radius: 3px; margin-top: .1em; }
.form-check-input:checked { background-color: var(--md-primary); border-color: var(--md-primary); }
.form-check-input:focus { box-shadow: 0 0 0 8px rgba(244,123,32,.12); border-color: var(--md-primary); }
.form-switch .form-check-input { width: 52px; height: 32px; border-radius: 100px; border: 2px solid var(--md-outline); background-color: var(--md-surface-high); --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2.2' fill='%2385736A'/%3e%3c/svg%3e"); margin-right: .6rem; margin-top: -.15em; }
.form-switch .form-check-input:checked { background-color: var(--md-primary); border-color: var(--md-primary); --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.form-check-label { padding-top: .1em; }

/* ---------- Card, list, alert, badge ---------- */
.card { border: 0; border-radius: 16px; background: var(--md-card); box-shadow: var(--elev-1); overflow: hidden; }
.card-header { background: transparent; border-bottom: 0; font-weight: 500; font-size: 1rem; padding: 1rem 1rem .25rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header a.small { font-weight: 500; }
.card-body { padding: 1rem; }
.card.border-primary { box-shadow: inset 0 0 0 1px var(--md-primary), var(--elev-1); }
.card.border-success { box-shadow: inset 0 0 0 1px var(--ok), var(--elev-1); }
.list-group { --bs-list-group-bg: transparent; }
.list-group-item { border: 0; border-top: 1px solid var(--md-outline-variant); padding: .85rem 1rem; min-height: 56px; background: transparent; }
.list-group-flush > .list-group-item:first-child { border-top: 0; }
.list-group-item-action { position: relative; overflow: hidden; }
.list-group-item-action:hover, .list-group-item-action:focus { background: transparent; }
.list-group-item-action:active { background: rgba(34,26,21,.08); }
.alert { border: 0; border-radius: 12px; padding: .9rem 1rem; font-size: .9rem; }
.alert-success { background: var(--ok-container); color: #0A3A1E; }
.alert-danger { background: var(--md-error-container); color: #410002; }
.alert-warning { background: var(--warn-container); color: #2B1700; }
.alert-info { background: var(--info-container); color: #0A1C45; }
.alert-light { background: var(--md-surface-container); color: var(--md-on-surface-variant); }
.badge { border-radius: 8px; padding: .35em .6em; font-weight: 500; font-size: .72rem; letter-spacing: .02em; }
.bg-primary { background-color: var(--md-primary) !important; }
.bg-success { background-color: var(--ok-container) !important; color: #0A3A1E !important; }
.bg-warning { background-color: var(--warn-container) !important; color: #2B1700 !important; }
.bg-danger { background-color: var(--md-error-container) !important; color: #410002 !important; }
.bg-info { background-color: var(--info-container) !important; color: #0A1C45 !important; }
.bg-dark { background-color: var(--md-inverse-surface) !important; color: var(--md-inverse-on-surface) !important; }
.bg-orange { background-color: var(--md-primary-container) !important; color: var(--md-on-primary-container) !important; }
.bg-teal { background-color: #CDEFE4 !important; color: #00382A !important; }
.bg-secondary { background-color: var(--md-surface-high) !important; color: var(--md-on-surface-variant) !important; }
.bg-light { background-color: var(--md-surface-container) !important; }
.badge.bg-primary { background: var(--md-primary-container) !important; color: var(--md-on-primary-container) !important; }
.pagination { gap: 4px; justify-content: center; }
.page-link { border-radius: 100px !important; border: 0; color: var(--md-on-surface-variant); min-width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: transparent; }
.page-item.active .page-link { background: var(--md-secondary-container); color: var(--md-on-secondary-container); font-weight: 700; }
nav .small.text-muted { text-align: center; }
.dropdown-menu { border: 0; border-radius: 4px 4px 12px 12px; box-shadow: var(--elev-2); padding: .5rem 0; background: var(--md-surface-container); min-width: 220px; animation: menuIn .2s var(--decel); transform-origin: top right; }
.dropdown-item { padding: .8rem 1rem; font-size: .95rem; }
.dropdown-item:active, .dropdown-item:hover { background: rgba(34,26,21,.08); color: inherit; }
.dropdown-divider { border-color: var(--md-outline-variant); }
details summary { color: var(--md-primary-dark); font-weight: 500; padding: .4rem 0; }
pre { border-radius: 8px; background: var(--md-surface-container) !important; }
hr { border-color: var(--md-outline-variant); opacity: 1; }
.code { font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 500; letter-spacing: .01em; }

/* =====================================================================
   APP SHELL ANDROID
   ===================================================================== */
.app-shell { min-height: 100vh; min-height: 100dvh; }

/* Top app bar */
.appbar { position: sticky; top: 0; z-index: 1030; padding-top: var(--safe-top); background: var(--md-primary); color: #fff; transition: box-shadow .25s; }
.appbar.scrolled { box-shadow: var(--elev-2); }
.appbar-inner { height: var(--appbar-h); display: flex; align-items: center; gap: .25rem; padding: 0 .25rem; max-width: 1000px; margin: 0 auto; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: inherit; background: transparent; border: 0; position: relative; overflow: hidden; flex-shrink: 0; }
.icon-btn i { font-size: 1.45rem; }
.icon-btn:active { background: rgba(255,255,255,.18); }
.appbar .title { flex: 1; min-width: 0; padding: 0 .35rem; line-height: 1.2; }
.appbar .title .t { font-size: 1.3rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.appbar .title .s { font-size: .74rem; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.appbar .dot { position: absolute; top: 8px; right: 8px; min-width: 16px; height: 16px; border-radius: 100px; background: #B3261E; color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 1.5px solid var(--md-primary); }
.appbar .avatar { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--md-primary-dark); font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; }
.appbar .avatar-btn { width: 48px; height: 48px; border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.appbar .avatar-btn:active { background: rgba(255,255,255,.18); }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--md-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }

/* Linear progress (M3) di bawah app bar saat pindah halaman */
.nav-progress { position: fixed; left: 0; right: 0; top: calc(var(--appbar-h) + var(--safe-top)); height: 4px; z-index: 1031; overflow: hidden; opacity: 0; transition: opacity .2s; background: var(--md-primary-container); }
.nav-progress::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--md-primary-dark); }
.nav-progress.run { opacity: 1; }
.nav-progress.run::after { animation: indeterminate 1.1s var(--emph) infinite; }
body.public .nav-progress, body.login .nav-progress { top: var(--safe-top); }

/* Area konten */
.app-main { padding: 12px 12px calc(var(--navbar-h) + var(--safe-bottom) + 88px); }
.app-content { max-width: 840px; margin: 0 auto; animation: fadeThrough .3s var(--decel) both; }
body.leaving .app-content { animation: fadeOut .09s linear forwards; }
.app-content > .alert, .app-content > .card, .app-content > .row, .app-content > form, .app-content > div { margin-bottom: 12px; }

/* Navigation bar (M3 bottom navigation) */
.navbar-m3 { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; height: calc(var(--navbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); background: var(--md-surface-container); display: flex; justify-content: center; box-shadow: 0 -1px 0 rgba(0,0,0,.04); }
.navbar-m3 .nav-wrap { display: flex; width: 100%; max-width: 640px; }
.navbar-m3 a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--md-on-surface-variant); font-size: .75rem; font-weight: 500; letter-spacing: .03em; height: var(--navbar-h); position: relative; padding-top: 4px; }
.navbar-m3 .ind { width: 64px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.navbar-m3 .ind::before { content: ''; position: absolute; inset: 0; border-radius: 16px; background: var(--md-secondary-container); transform: scaleX(0); opacity: 0; transition: transform .35s var(--emph), opacity .2s; }
.navbar-m3 .ind i { font-size: 1.35rem; position: relative; z-index: 1; transition: transform .2s; }
.navbar-m3 a.active { color: var(--md-on-surface); font-weight: 700; }
.navbar-m3 a.active .ind::before { transform: scaleX(1); opacity: 1; }
.navbar-m3 a.active .ind i { color: var(--md-on-secondary-container); }
.navbar-m3 a:active .ind::after { content: ''; position: absolute; inset: 0; background: rgba(34,26,21,.1); border-radius: 16px; }
.navbar-m3 .nbadge { position: absolute; top: 2px; left: 36px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 100px; background: #B3261E; color: #fff; font-size: .62rem; display: flex; align-items: center; justify-content: center; z-index: 2; }

/* FAB (M3, extended → kecil saat scroll) */
.fab { position: fixed; right: 16px; bottom: calc(var(--navbar-h) + var(--safe-bottom) + 16px); z-index: 1035; height: 56px; min-width: 56px; padding: 0 20px 0 16px; border-radius: 16px; background: var(--md-primary-container); color: var(--md-on-primary-container); display: inline-flex; align-items: center; gap: 12px; box-shadow: var(--elev-3); font-weight: 500; font-size: .95rem; overflow: hidden; transition: padding .25s var(--emph), gap .25s var(--emph), box-shadow .2s; animation: fabIn .4s var(--decel) .15s both; }
.fab i { font-size: 1.5rem; }
.fab .lbl { max-width: 160px; white-space: nowrap; overflow: hidden; transition: max-width .25s var(--emph), opacity .2s; }
.fab.shrink { padding: 0 16px; gap: 0; }
.fab.shrink .lbl { max-width: 0; opacity: 0; }
.fab:active { box-shadow: var(--elev-2); color: var(--md-on-primary-container); }
.fab.fab-primary { background: var(--md-primary); color: #fff; }
@media (min-width: 840px) { .fab { right: calc((100vw - 840px) / 2 + 16px); } }

/* Navigation drawer (M3 modal) */
.drawer.offcanvas { width: min(85vw, 360px); border: 0; border-radius: 0 16px 16px 0; background: var(--md-surface-low); }
.drawer .drawer-head { padding: calc(1.2rem + var(--safe-top)) 1.5rem 1rem; display: flex; align-items: center; gap: .9rem; }
.drawer .drawer-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--md-primary); color: #fff; font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.drawer .menu { padding: 0 .75rem calc(1rem + var(--safe-bottom)); }
.drawer .menu .sec { font-size: .82rem; font-weight: 500; color: var(--md-on-surface-variant); padding: 1rem 1rem .4rem; }
.drawer .menu a { display: flex; align-items: center; gap: .9rem; height: 56px; padding: 0 1rem; border-radius: 28px; color: var(--md-on-surface-variant); font-weight: 500; font-size: .92rem; position: relative; overflow: hidden; opacity: 0; transform: translateX(-10px); }
.drawer .menu a i { font-size: 1.3rem; width: 24px; text-align: center; }
.drawer .menu a.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); font-weight: 700; }
.drawer .menu a:active { background: rgba(34,26,21,.08); }
.drawer.showing .menu a, .drawer.show .menu a { animation: slideIn .3s var(--decel) forwards; }
.drawer hr { margin: .5rem 1rem; }
.offcanvas-backdrop.show { opacity: .32; }

/* Snackbar */
.snackbar-host { position: fixed; left: 12px; right: 12px; bottom: calc(var(--navbar-h) + var(--safe-bottom) + 12px); z-index: 1080; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
body.no-nav .snackbar-host { bottom: calc(var(--safe-bottom) + 16px); }
.snackbar { pointer-events: auto; width: 100%; max-width: 560px; background: var(--md-inverse-surface); color: var(--md-inverse-on-surface); border-radius: 4px; box-shadow: var(--elev-3); padding: .85rem 1rem; display: flex; align-items: center; gap: .75rem; font-size: .9rem; animation: snackIn .3s var(--decel) both; }
.snackbar i.lead { font-size: 1.2rem; }
.snackbar.ok i.lead { color: #8BE0A8; } .snackbar.err i.lead { color: #FFB4AB; } .snackbar.warn i.lead { color: #FFD180; }
.snackbar .act { margin-left: auto; background: none; border: 0; color: #FFB68A; font-weight: 500; padding: .25rem .5rem; flex-shrink: 0; }
.snackbar.out { animation: snackOut .2s ease forwards; }

/* Dialog (M3) */
.m3-dialog { position: fixed; inset: 0; z-index: 1090; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.32); animation: fadeIn .15s linear; }
.m3-dialog .box { background: var(--md-surface-high); border-radius: 28px; padding: 24px; width: 100%; max-width: 360px; box-shadow: var(--elev-3); animation: dialogIn .3s var(--decel); }
.m3-dialog .ico { color: var(--md-primary-dark); font-size: 1.6rem; text-align: center; margin-bottom: 12px; }
.m3-dialog h3 { font-size: 1.4rem; font-weight: 400; text-align: center; margin: 0 0 12px; }
.m3-dialog p { color: var(--md-on-surface-variant); font-size: .92rem; margin: 0 0 20px; }
.m3-dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.m3-dialog .actions button { background: none; border: 0; color: var(--md-primary-dark); font-weight: 500; padding: .55rem 1rem; border-radius: 100px; min-height: 40px; position: relative; overflow: hidden; }
.m3-dialog .actions button:active { background: rgba(244,123,32,.12); }

/* =====================================================================
   KOMPONEN HALAMAN
   ===================================================================== */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dup-title { display: none !important; }
.page-head:has(.dup-title):not(:has(.btn)):not(:has(form)) { display: none !important; }
.app-content a.small:has(> .bi-arrow-left) { display: none; }
.app-content > .d-flex.flex-wrap.justify-content-between { justify-content: flex-start !important; }

/* Kartu sapaan (header) */
.hero { background: var(--grad); color: #fff; border-radius: 28px; padding: 20px; position: relative; overflow: hidden; margin-bottom: 12px; }
.hero::before { content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.12); right: -60px; top: -80px; animation: drift 9s ease-in-out infinite; }
.hero::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.08); right: 60px; bottom: -60px; animation: drift 12s ease-in-out infinite reverse; }
.hero > * { position: relative; z-index: 1; }
.hero .hi { font-size: .88rem; opacity: .92; }
.hero h1 { color: #fff; font-size: 1.5rem; font-weight: 500; margin: 2px 0 6px; }
.hero .hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero .btn-light { background: #fff; color: var(--md-primary-dark); }
.hero .btn-ghost { background: rgba(255,255,255,.2); color: #fff; border: 0; }
.hero-bolt { position: absolute !important; right: 18px; top: 14px; font-size: 3rem; opacity: .28; animation: charge 2.4s ease-in-out infinite; }

/* Statistik */
.stat { border-radius: 16px; padding: 14px 14px 12px; background: var(--md-card); box-shadow: var(--elev-1); height: 100%; position: relative; overflow: hidden; display: block; color: var(--md-on-surface); }
a > .stat:active, a:active > .stat { background: var(--md-surface-low); }
.stat::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--md-primary)); }
.stat .v { font-size: 1.65rem; font-weight: 500; line-height: 1.1; margin-top: 4px; }
.stat .l { color: var(--md-on-surface-variant); font-size: .76rem; font-weight: 500; line-height: 1.25; min-height: 2.5em; }
.stat.ok { --c: var(--ok); } .stat.warn { --c: #E8A317; } .stat.bad { --c: var(--md-error); } .stat.info { --c: var(--md-primary); } .stat.dark { --c: var(--md-inverse-surface); }

/* Kode ID besar */
.id-big { font-size: 1.4rem; font-family: "Roboto Mono", ui-monospace, monospace; font-weight: 700; background: var(--md-primary-container); color: var(--md-on-primary-container); padding: .6rem 1rem; border-radius: 12px; display: inline-block; word-break: break-all; animation: popIn .45s var(--decel) both; }

/* Daftar definisi */
.dl-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.dl-grid dt { color: var(--md-on-surface-variant); font-weight: 400; font-size: .76rem; margin-top: .7rem; }
.dl-grid dt:first-child { margin-top: 0; }
.dl-grid dd { margin: 0; word-break: break-word; font-size: .95rem; }

/* Timeline */
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; border-left: 2px solid var(--md-outline-variant); margin-left: .45rem; animation: rise .35s var(--decel) both; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--md-card); border: 2px solid var(--md-primary); }
.timeline li:last-child::before { background: var(--md-primary); box-shadow: 0 0 0 4px rgba(244,123,32,.2); }

.photo-thumb { max-width: 100%; max-height: 360px; border-radius: 12px; }
.mobile-cards .item { background: var(--md-card); border-radius: 16px; padding: 14px 16px; margin-bottom: 8px; box-shadow: var(--elev-1); position: relative; overflow: hidden; animation: rise .3s var(--decel) both; }
.mobile-cards .item:active { background: var(--md-surface-low); }
.d-md-none.mobile-cards { display: block !important; }
.card:has(> .d-md-none.mobile-cards) { background: transparent; box-shadow: none; overflow: visible; }
.card > .table-responsive.d-none.d-md-block { display: none !important; }

/* Chips (M3 filter chips) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 12px 4px; margin: 0 -12px 12px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chips .btn { flex-shrink: 0; border-radius: 8px; min-height: 32px; height: 32px; padding: 0 12px; font-size: .84rem; border: 1px solid var(--md-outline); background: transparent; color: var(--md-on-surface-variant); scroll-snap-align: start; }
.chips .btn .badge { background: transparent !important; color: inherit !important; padding: 0 0 0 2px; font-size: .8rem; }
.chips .btn-dark { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }
.chips .btn-dark::before { content: '\2713'; font-weight: 700; margin-right: 2px; }

/* Panel filter: dilipat seperti aplikasi */
.filter-toggle { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: var(--md-surface-container); color: var(--md-on-surface-variant); border-radius: 28px; height: 52px; padding: 0 16px; font-size: .95rem; position: relative; overflow: hidden; margin-bottom: 12px; text-align: left; }
.filter-toggle i.bi-sliders { margin-left: auto; color: var(--md-primary-dark); }
.filter-toggle .fcount { background: var(--md-primary); color: #fff; border-radius: 100px; font-size: .7rem; padding: 1px 7px; }
form.filters { border-radius: 16px; overflow: hidden; transition: max-height .3s var(--emph), opacity .2s, margin .3s; }
form.filters.collapsed { max-height: 0 !important; opacity: 0; padding-top: 0 !important; padding-bottom: 0 !important; margin-bottom: 0 !important; box-shadow: none; }
form.filters .row > [class*="col-"] { width: 100%; flex: 0 0 auto; }
form.filters .row > [class*="col-"]:has(input[type=date]) { width: 50%; }
form.filters .btn { width: 100%; }

/* Tabel → kartu (selalu) */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table-responsive { overflow: visible; }
.table-app thead { display: none; }
.table-app, .table-app tbody, .table-app tr, .table-app td { display: block; width: 100%; }
.table-app { min-width: 0 !important; }
.table-app tr { background: var(--md-card); border-radius: 16px; margin: 0 0 8px; padding: 10px 16px; box-shadow: var(--elev-1); animation: rise .3s var(--decel) both; position: relative; }
.table-app td { border: 0 !important; padding: 5px 0 !important; display: flex; justify-content: flex-end; align-items: flex-start; gap: 6px; text-align: right !important; background: transparent !important; white-space: normal !important; min-width: 0 !important; max-width: none !important; font-size: .9rem; }
.table-app td::before { content: attr(data-label); color: var(--md-on-surface-variant); font-size: .78rem; text-align: left; flex: 0 0 42%; padding-top: 1px; margin-right: auto; }
.table-app td[data-label=""]::before { display: none; }
.table-app td[data-label=""] { justify-content: flex-end; }
.table-app td:first-child { font-weight: 500; font-size: 1rem; padding-bottom: 8px !important; margin-bottom: 4px; border-bottom: 1px solid var(--md-outline-variant) !important; }
.table-app td[colspan] { justify-content: center; text-align: center !important; }
.table-app td[colspan]::before { display: none; }
.table-app tr.collapsed td.extra { display: none; }
.table-app .more-btn { display: flex; width: 100%; justify-content: center; align-items: center; gap: 4px; border: 0; background: none; color: var(--md-primary-dark); font-weight: 500; font-size: .84rem; padding: 6px 0 2px; }
.table-app tr.table-light, .table-app tr.table-warning { background: var(--md-card); }
.card:has(> .table-responsive > .table-app), .card:has(> .card-body > .table-responsive > .table-app) { background: transparent; box-shadow: none; overflow: visible; }
.card:has(> .table-responsive > .table-app) > .card-header { padding: 4px 4px 10px; }
.table-app td .btn { min-height: 36px; }

/* Kartu pilihan jalur (konsumen) */
.path-card { color: inherit; display: flex; flex-direction: column; border-radius: 24px !important; position: relative; overflow: hidden; padding: 20px !important; }
.path-card:active { background: var(--md-surface-low); }
.path-card .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--md-primary-container); color: var(--md-on-primary-container); display: flex; align-items: center; justify-content: center; font-size: 1.7rem; flex-shrink: 0; }
.path-card.featured { background: var(--grad); color: #fff; }
.path-card.featured:active { filter: brightness(.95); }
.path-card.featured .ico { background: rgba(255,255,255,.22); color: #fff; }
.path-card.featured .text-muted { color: rgba(255,255,255,.9) !important; }

/* Formulir konsumen */
.step { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--md-primary); color: #fff; font-size: .78rem; font-weight: 700; align-items: center; justify-content: center; margin-right: 10px; }
.card-header:has(.step) { justify-content: flex-start; }
.upload-drop { display: flex; align-items: center; justify-content: center; position: relative; min-height: 168px; border: 1px dashed var(--md-outline); border-radius: 16px; background: var(--md-surface-low); cursor: pointer; overflow: hidden; }
.upload-drop:active { background: var(--md-surface-container); }
.upload-drop .up-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 1rem; color: var(--md-on-surface-variant); }
.upload-drop .up-empty i { font-size: 2.2rem; color: var(--md-primary); width: 64px; height: 64px; border-radius: 50%; background: var(--md-primary-container); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.upload-drop .up-empty b { font-weight: 500; color: var(--md-on-surface); }
.upload-drop img { width: 100%; max-height: 320px; object-fit: contain; background: #fff; animation: popIn .4s var(--decel); }
.upload-drop .up-change { display: none; position: absolute; bottom: 10px; right: 10px; background: var(--md-inverse-surface); color: #fff; padding: .4rem .8rem; border-radius: 8px; font-size: .78rem; }
.upload-drop.has-file { border-style: solid; border-color: var(--ok); }
.upload-drop.has-file .up-empty { display: none; }
.upload-drop.has-file .up-change { display: inline-flex; gap: .3rem; }
.was-validated .card:has(.upload-input:invalid) .upload-drop { border-color: var(--md-error); background: var(--md-error-container); }
.submit-bar { position: sticky; bottom: calc(var(--navbar-h) + var(--safe-bottom) + 12px); z-index: 5; }
body.no-nav .submit-bar { bottom: calc(var(--safe-bottom) + 12px); }
.submit-bar .btn { box-shadow: var(--elev-3); }
.page-card { background: var(--md-card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--elev-1); font-size: 1.1rem !important; font-weight: 500; }

/* Empty state */
.empty { text-align: center; padding: 2rem 1rem; color: var(--md-on-surface-variant); }

/* Ripple (Material) */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .16; animation: ripple .5s var(--emph) forwards; pointer-events: none; }
.btn-primary .ripple, .btn-success .ripple, .fab-primary .ripple, .hero .ripple, .appbar .ripple, .path-card.featured .ripple { background: #fff; opacity: .3; }

/* =====================================================================
   HALAMAN PUBLIK (konsumen) & LOGIN
   ===================================================================== */
.welcome { background: var(--grad); color: #fff; border-radius: 28px; padding: 22px 20px 24px; position: relative; overflow: hidden; margin-bottom: 12px; }
.welcome::before { content: ''; position: absolute; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.12); right: -80px; top: -110px; animation: drift 10s ease-in-out infinite; }
.welcome > * { position: relative; }
.welcome h1 { color: #fff; font-size: 1.6rem; font-weight: 500; margin: 4px 0 6px; line-height: 1.2; }
.welcome .bolt { position: absolute; right: 18px; bottom: 14px; font-size: 3.4rem; opacity: .25; animation: charge 2.4s ease-in-out infinite; }

.login-page { min-height: 100vh; min-height: 100dvh; background: var(--md-primary); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-page .bubble { position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); animation: drift 10s ease-in-out infinite; }
.login-top { padding: calc(2.6rem + var(--safe-top)) 1.5rem 2rem; color: #fff; text-align: center; position: relative; z-index: 1; }
.login-logo { width: 80px; height: 80px; border-radius: 24px; background: #fff; color: var(--md-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 2.4rem; box-shadow: var(--elev-3); animation: popIn .5s var(--decel) both; }
.login-logo i { animation: charge 2.4s ease-in-out infinite; }
.login-top h1 { color: #fff; font-weight: 500; }
.login-sheet { flex: 1; background: var(--md-surface); border-radius: 28px 28px 0 0; padding: 28px 20px calc(24px + var(--safe-bottom)); position: relative; z-index: 1; animation: sheetUp .45s var(--decel) both; }
.login-sheet .inner { max-width: 440px; margin: 0 auto; }
.login-sheet .sheet-handle { width: 32px; height: 4px; border-radius: 2px; background: var(--md-outline); opacity: .4; margin: -14px auto 18px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--md-on-surface-variant); font-size: 1.2rem; pointer-events: none; }
.input-icon .form-control { padding-left: 46px; }
.input-icon .toggle-pass { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--md-on-surface-variant); width: 48px; height: 48px; border-radius: 50%; }

/* =====================================================================
   ANIMASI (Material motion)
   ===================================================================== */
@keyframes fadeThrough { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes menuIn { from { opacity: 0; transform: scaleY(.6); } to { opacity: 1; transform: none; } }
@keyframes dialogIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes snackIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes snackOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes fabIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: none; } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes indeterminate { 0% { left: -40%; width: 40%; } 60% { left: 50%; width: 60%; } 100% { left: 110%; width: 30%; } }
@keyframes charge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes drift { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-12px, 10px); } }
.stagger > * { animation: rise .35s var(--decel) both; }
.stagger > *:nth-child(2) { animation-delay: .03s; } .stagger > *:nth-child(3) { animation-delay: .06s; } .stagger > *:nth-child(4) { animation-delay: .09s; }
.stagger > *:nth-child(5) { animation-delay: .12s; } .stagger > *:nth-child(6) { animation-delay: .15s; } .stagger > *:nth-child(n+7) { animation-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print { .appbar, .navbar-m3, .fab, .no-print, .drawer, .snackbar-host { display: none !important; } .app-main { padding: 0; } body { background: #fff; } }
.table-app td::before { font-family: var(--bs-body-font-family); font-weight: 400; letter-spacing: 0; }
.table-app > :not(caption) > * > * { box-shadow: none !important; }
.table-app td.code, .table-app td .code { font-size: .86rem; }
