/* ========================================================================
   APEX KASIR — LIQUID GLASS MOTION SYSTEM
   Motion dibuat berlapis, ringan, konsisten, dan tetap menghormati reduced motion.
   ======================================================================== */

:root {
  --apex-ease-out: cubic-bezier(.22, 1, .36, 1);
  --apex-ease-spring: cubic-bezier(.2, .9, .25, 1.12);
  --apex-glass-blur: 16px;
  --apex-glass-highlight: rgba(255, 255, 255, .58);
  --apex-glass-shadow: 0 16px 42px rgba(31, 48, 82, .085);
  --apex-motion-fast: 140ms;
  --apex-motion-normal: 240ms;
}

/* Theme changes dissolve smoothly rather than flashing between surfaces. */
html.is-theme-transitioning,
html.is-theme-transitioning body,
html.is-theme-transitioning body * {
  transition-property: background-color, color, border-color, box-shadow, fill, stroke !important;
  transition-duration: 380ms !important;
  transition-timing-function: ease !important;
}

/* Liquid surfaces across the workspace. */
#sb,
header,
.card,
#bn,
.mc,
.settings-store-card,
.settings-list,
.receipt-settings-card,
.pl-card,
.finder-launch,
.printer-settings-hero,
.printer-help-box {
  -webkit-backdrop-filter: blur(var(--apex-glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--apex-glass-blur)) saturate(160%);
}

#sb,
header,
.card,
#bn,
.mc,
.settings-store-card,
.settings-list,
.receipt-settings-card,
.pl-card {
  border-color: var(--gb, var(--bd));
  box-shadow: var(--apex-glass-shadow), inset 0 1px 0 var(--apex-glass-highlight);
}

.card {
  transition:
    transform 240ms var(--apex-ease-out),
    box-shadow 240ms var(--apex-ease-out),
    border-color 180ms ease,
    background 180ms ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--pr) 19%, var(--gb, var(--bd)));
  box-shadow: 0 18px 46px rgba(31, 48, 82, .105), inset 0 1px 0 var(--apex-glass-highlight);
}

:root[data-theme="dark"] .card:hover {
  box-shadow: 0 18px 42px rgba(0, 0, 0, .27), inset 0 1px 0 rgba(255,255,255,.045);
}

/* Sidebar and top navigation feel like floating glass panels. */
#sb {
  transition:
    width 260ms var(--apex-ease-out),
    transform 260ms var(--apex-ease-out),
    box-shadow 200ms ease;
}

#sb a {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    color 220ms ease,
    background 260ms ease,
    border-color 260ms ease,
    transform 260ms var(--apex-ease-out),
    box-shadow 260ms ease;
}

#sb a::before {
  content: "";
  position: absolute;
  inset: 5px auto 5px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--pr);
  opacity: 0;
  transform: scaleY(.35);
  transition: opacity 240ms ease, transform 320ms var(--apex-ease-out);
}

#sb a.on::before {
  opacity: 1;
  transform: scaleY(1);
}

#sb a:hover {
  transform: translateX(3px);
}

header {
  transition:
    background 260ms ease,
    border-color 260ms ease,
    box-shadow 320ms ease,
    transform 360ms var(--apex-ease-out);
}

.ib,
.av,
.btn,
.seg button,
.chip,
.pi,
#bn a,
#bn button {
  -webkit-tap-highlight-color: transparent;
}

.ib,
.av,
.btn,
.seg button,
.chip,
#bn a,
#bn button {
  transition:
    transform 220ms var(--apex-ease-out),
    background 240ms ease,
    border-color 240ms ease,
    box-shadow 260ms ease,
    color 220ms ease,
    filter 220ms ease;
}

.btn:hover:not(:disabled),
.ib:hover:not(:disabled),
.av:hover,
#bn a:hover,
#bn button:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 22px rgba(31, 48, 82, .11);
}

.btn:active:not(:disabled),
.ib:active:not(:disabled),
.av:active,
#bn a:active,
#bn button:active,
.seg button:active,
.chip:active {
  transform: scale(.965);
}

.btn.p {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--pr) 23%, transparent);
}

.btn.p::after,
.auth-submit::after {
  content: "";
  position: absolute;
  inset: -60% auto -60% -45%;
  width: 34%;
  pointer-events: none;
  transform: translateX(-170%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
}

.btn.p:hover::after,
.auth-submit:hover::after {
  animation: apexButtonShine 480ms var(--apex-ease-out);
}

@keyframes apexButtonShine {
  to { transform: translateX(510%) skewX(-18deg); }
}

/* A restrained ripple is injected only on intentional pointer interactions. */
.apex-ripple-host {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate;
}

.apex-ripple {
  position: absolute;
  z-index: 3;
  display: block;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.48) 0%, rgba(147,197,253,.22) 35%, transparent 72%);
  transform: scale(.08);
  opacity: .8;
  animation: apexRippleWave 360ms ease-out forwards;
}

@keyframes apexRippleWave {
  65% { opacity: .34; }
  100% { transform: scale(1); opacity: 0; }
}

/* Product cards respond like physical glass tiles. */
.pi {
  position: relative;
  overflow: hidden;
  border-color: var(--gb, var(--bd));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42);
  transition:
    transform 220ms var(--apex-ease-out),
    box-shadow 220ms var(--apex-ease-out),
    border-color 180ms ease,
    background 180ms ease;
}

.pi:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.012);
  box-shadow: 0 15px 30px rgba(31,48,82,.12), inset 0 1px 0 rgba(255,255,255,.65);
}

.pi .th {
  transition: transform 240ms var(--apex-ease-out), filter 180ms ease;
}

.pi:hover:not(:disabled) .th {
  transform: scale(1.035);
  filter: saturate(1.08);
}

/* Main page: gentle entrance with short stagger, never a hard jump. */
#view.is-view-entering > * {
  animation: apexViewIn 320ms var(--apex-ease-out) both;
  animation-delay: var(--apex-enter-delay, 0ms);
}

#view.is-view-entering .stats .card,
#view.is-view-entering .g2 > .card,
#view.is-view-entering .g3 > .card,
#view.is-view-entering > .card {
  animation: apexGlassCardIn 360ms var(--apex-ease-out) both;
  animation-delay: calc(var(--apex-enter-delay, 0ms) + 45ms);
}

#view.is-view-entering .stats .card:nth-child(2),
#view.is-view-entering .g2 > .card:nth-child(2),
#view.is-view-entering .g3 > .card:nth-child(2) { animation-delay: 95ms; }
#view.is-view-entering .stats .card:nth-child(3),
#view.is-view-entering .g3 > .card:nth-child(3) { animation-delay: 145ms; }
#view.is-view-entering .stats .card:nth-child(4) { animation-delay: 195ms; }
#view.is-view-entering .stats .card:nth-child(5) { animation-delay: 245ms; }
#view.is-view-entering .stats .card:nth-child(6) { animation-delay: 295ms; }

@keyframes apexViewIn {
  from { opacity: 0; transform: translate3d(0, 14px, 0); filter: blur(2px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

@keyframes apexGlassCardIn {
  0% { opacity: 0; transform: translate3d(0, 20px, 0) scale(.985); filter: blur(3px); }
  72% { opacity: 1; }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

/* App reveal after a successful login/signup. The auth card becomes a soft glass curtain. */
body.apex-app-preparing #auth-screen {
  pointer-events: none;
}

#auth-screen.is-exiting {
  animation: apexAuthCurtainOut 360ms cubic-bezier(.65, 0, .35, 1) both;
  pointer-events: none;
}

#auth-screen.is-exiting .auth-shell {
  animation: apexAuthCardExit 340ms var(--apex-ease-out) both;
}

@keyframes apexAuthCurtainOut {
  0% { opacity: 1; backdrop-filter: blur(0); }
  35% { opacity: .96; backdrop-filter: blur(6px); }
  100% { opacity: 0; backdrop-filter: blur(18px); }
}

@keyframes apexAuthCardExit {
  0% { opacity: 1; transform: perspective(1400px) translateY(0) scale(1) rotateX(0); filter: blur(0); }
  100% { opacity: 0; transform: perspective(1400px) translateY(-24px) scale(.965) rotateX(2deg); filter: blur(8px); }
}

.auth-shell.is-returning {
  animation: apexAuthReturn 320ms var(--apex-ease-out) both;
}

@keyframes apexAuthReturn {
  0% { opacity: 0; transform: translateY(22px) scale(.975); filter: blur(8px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

body.apex-app-entering #sb {
  animation: apexSidebarEnter 320ms var(--apex-ease-out) both;
}

body.apex-app-entering #main {
  animation: apexWorkspaceEnter 360ms 35ms var(--apex-ease-out) both;
}

body.apex-app-entering header {
  animation: apexHeaderEnter 300ms 55ms var(--apex-ease-out) both;
}

body.apex-app-entering #bn {
  animation: apexBottomNavEnter 280ms 75ms var(--apex-ease-out) both;
}

body.apex-app-entering #view > * {
  animation: apexViewIn 320ms 90ms var(--apex-ease-out) both;
}

@keyframes apexSidebarEnter {
  from { opacity: 0; transform: translateX(-24px); filter: blur(5px); }
  to { opacity: 1; transform: translateX(0); filter: blur(0); }
}

@keyframes apexWorkspaceEnter {
  from { opacity: 0; transform: translateY(16px) scale(.992); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes apexHeaderEnter {
  from { opacity: 0; transform: translateY(-18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes apexBottomNavEnter {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Auth screen: layered glass, ambient light and more expressive form feedback. */
#auth-screen {
  perspective: 1600px;
  isolation: isolate;
}

#auth-screen::before {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 24%, rgba(59,130,246,.16), transparent 28%),
    radial-gradient(circle at 82% 76%, rgba(14,165,233,.13), transparent 30%);
  animation: apexAuthAtmosphere 16s ease-in-out infinite alternate;
}

@keyframes apexAuthAtmosphere {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

.auth-shell {
  transform-style: preserve-3d;
  border-color: rgba(255,255,255,.72);
  box-shadow: 0 36px 110px rgba(31,54,94,.18), 0 5px 20px rgba(31,54,94,.055), inset 0 1px 0 rgba(255,255,255,.96);
  transition: box-shadow 240ms ease, border-color 180ms ease;
}

.auth-shell:hover {
  box-shadow: 0 42px 120px rgba(31,54,94,.21), 0 7px 26px rgba(31,54,94,.08), inset 0 1px 0 rgba(255,255,255,.98);
}

.auth-brand {
  isolation: isolate;
}

.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .56;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.10) 47%, transparent 68%);
  transform: translateX(-110%);
  animation: apexBrandGlint 9s 1s ease-in-out infinite;
}

@keyframes apexBrandGlint {
  0%, 62%, 100% { transform: translateX(-110%); }
  76% { transform: translateX(110%); }
}

.auth-orb-one { animation: apexOrbFloat 12s ease-in-out infinite alternate; }
.auth-orb-two { animation: apexOrbFloat 9s -2s ease-in-out infinite alternate-reverse; }

@keyframes apexOrbFloat {
  from { transform: translate3d(0, 0, 0) scale(.98); }
  to { transform: translate3d(-22px, 18px, 0) scale(1.06); }
}

.auth-mark {
  position: relative;
  overflow: hidden;
  transition: transform 220ms var(--apex-ease-out), box-shadow 200ms ease;
}

.auth-mark:hover {
  transform: translateY(-3px) rotate(-5deg) scale(1.04);
  box-shadow: 0 14px 28px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.5);
}

.auth-panel {
  transform-origin: center;
}

.auth-heading h2 {
  text-wrap: balance;
}

.auth-input-wrap {
  transition:
    border-color 260ms ease,
    background 260ms ease,
    box-shadow 320ms var(--apex-ease-out),
    transform 260ms var(--apex-ease-out);
}

.auth-input-wrap:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(37,99,235,.09), 0 9px 22px rgba(37,99,235,.075), inset 0 1px 0 rgba(255,255,255,.55);
}

.auth-submit {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 280ms var(--apex-ease-out), box-shadow 320ms ease, filter 260ms ease;
}

.auth-submit:active:not(:disabled) {
  transform: scale(.985);
}

.auth-shell.is-auth-busy .auth-submit svg {
  opacity: 0;
}

.auth-shell.is-auth-busy .auth-submit::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: apexSpinner 720ms linear infinite;
}

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

.auth-shell.is-auth-success .auth-submit {
  background: linear-gradient(110deg, #16a34a, #059669);
  box-shadow: 0 10px 26px rgba(22,163,74,.22);
  transform: scale(1.015);
}

.auth-shell.is-auth-success .auth-panel {
  animation: apexAuthSuccess 460ms var(--apex-ease-out) both;
}

@keyframes apexAuthSuccess {
  0% { transform: scale(1); }
  45% { transform: scale(1.012); }
  100% { transform: scale(1); }
}

.auth-message {
  animation: apexMessageIn 300ms var(--apex-ease-out) both;
}

@keyframes apexMessageIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-account-switch button,
.auth-text-btn,
.auth-theme-switch button {
  transition: color 220ms ease, background 240ms ease, transform 240ms var(--apex-ease-out);
}

.auth-account-switch button:hover,
.auth-text-btn:hover {
  transform: translateX(2px);
}

/* Signup/login swap receives a deeper glass-card parallax feeling on desktop. */
@media (min-width: 801px) {
  .auth-shell > .auth-brand,
  .auth-shell > .auth-panel-wrap {
    transition: transform 420ms cubic-bezier(.2, .85, .2, 1), filter 220ms ease;
    will-change: transform;
  }
  .auth-shell.is-mode-changing > .auth-brand {
    filter: saturate(1.08);
  }
  .auth-shell.is-mode-changing > .auth-panel-wrap {
    filter: saturate(1.04);
  }
  .auth-shell.is-mode-changing .auth-transition-blade {
    opacity: 1;
  }
}

/* Modal and toast motion: soft blur-in and spring settle. */
#modal .mb {
  background: rgba(8, 13, 25, .36);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: background 220ms ease, backdrop-filter 260ms ease;
}

#modal.is-opening .mb {
  background: rgba(8, 13, 25, .42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#modal .mc {
  transform-origin: center;
  box-shadow: 0 28px 88px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.36);
}

#modal.is-closing .mb { animation: apexModalBackdropOut 190ms ease both; }
#modal.is-closing .mc { animation: apexModalOut 190ms var(--apex-ease-out) both; }

@keyframes apexModalBackdropOut { to { opacity: 0; backdrop-filter: blur(0); } }
@keyframes apexModalOut { to { opacity: 0; transform: translateY(10px) scale(.965); filter: blur(3px); } }

#toasts .ts {
  border: 1px solid var(--gb, var(--bd));
  border-left: 3px solid var(--ok);
  border-radius: 15px;
  background: color-mix(in srgb, var(--sheet) 88%, transparent);
  color: var(--tx);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 18px 45px rgba(15,23,42,.17), inset 0 1px 0 rgba(255,255,255,.42);
  animation: apexToastIn 420ms var(--apex-ease-spring) both;
}

#toasts .ts.dg { border-left-color: var(--dg); }

@keyframes apexToastIn {
  from { opacity: 0; transform: translate3d(24px, 12px, 0) scale(.96); filter: blur(4px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

#toasts .ts.is-leaving { animation: apexToastOut 240ms ease both; }
@keyframes apexToastOut { to { opacity: 0; transform: translateX(20px) scale(.97); } }

/* Smooth focus and hover states for forms and tables throughout the app. */
input, select, textarea {
  transition: border-color 220ms ease, box-shadow 260ms ease, background 240ms ease;
}

input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pr) 13%, transparent);
}

tbody tr {
  transition: background 200ms ease;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--hv) 78%, transparent);
}

/* Graphite dark mode retains neutral black/charcoal surfaces. */
:root[data-theme="dark"] #sb,
:root[data-theme="dark"] header,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .mc,
:root[data-theme="dark"] #bn,
:root[data-theme="dark"] .settings-store-card,
:root[data-theme="dark"] .settings-list {
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  box-shadow: 0 16px 42px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.035);
}

:root[data-theme="dark"] #toasts .ts {
  background: rgba(35,35,38,.91);
  box-shadow: 0 18px 46px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.05);
}

#bn a.on,
#bn button.on {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38), 0 7px 18px rgba(37,99,235,.12);
}

/* Reduced motion is a first-class setting, not an afterthought. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .apex-ripple { display: none !important; }
}


/* Dark auth appearance mirrors the app's graphite palette rather than navy panels. */
#auth-screen[data-auth-theme="dark"] {
  background:
    radial-gradient(900px 600px at 8% 8%, rgba(255,255,255,.045), transparent 60%),
    radial-gradient(700px 500px at 95% 95%, rgba(59,130,246,.075), transparent 62%),
    #0b0b0d;
  color: #f5f5f7;
}

#auth-screen[data-auth-theme="dark"] .auth-shell {
  border-color: rgba(255,255,255,.13);
  background: rgba(28,28,30,.76);
  box-shadow: 0 36px 110px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.075);
}

#auth-screen[data-auth-theme="dark"] .auth-panel-wrap {
  background: rgba(18,18,20,.88);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
}

#auth-screen[data-auth-theme="dark"] .auth-input-wrap,
#auth-screen[data-auth-theme="dark"] .auth-theme-switch {
  background: rgba(44,44,46,.72);
  border-color: rgba(84,84,88,.62);
}

#auth-screen[data-auth-theme="dark"] .auth-theme-switch button.active {
  background: rgba(72,72,74,.88);
  color: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

#auth-screen[data-auth-theme="dark"] .auth-google {
  background: rgba(44,44,46,.64);
  border-color: rgba(84,84,88,.62);
}

@media (prefers-reduced-motion: reduce) {
  #auth-screen::before,
  .auth-brand::after,
  .auth-orb-one,
  .auth-orb-two {
    animation: none !important;
  }
}


/* ========================================================================
   MOBILE PERFORMANCE PROFILE
   Reduce expensive blur, filter animation and staggered card motion on phones.
   Glass appearance remains through translucent fills, fine borders and highlights.
   ======================================================================== */
@media (max-width: 800px), (hover: none) and (pointer: coarse) {
  :root {
    --apex-glass-blur: 0px;
    --apex-motion-fast: 110ms;
    --apex-motion-normal: 170ms;
    --apex-glass-shadow: 0 5px 16px rgba(20, 35, 60, .07);
  }

  /* Backdrop filters on many cards are a major source of mobile frame drops. */
  #sb, header, .card, #bn, .mc, .settings-store-card, .settings-list,
  .receipt-settings-card, .pl-card, .finder-launch, .printer-settings-hero,
  .printer-help-box, #toasts .ts, .auth-shell, .auth-panel-wrap,
  #modal .mb, body::before, .gls {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  /* Avoid animating shadows, filters and large lists at the same time. */
  .card, .pi, #sb, #sb a, header, .btn, .ib, .av, .seg button, .chip,
  #bn a, #bn button, .auth-input-wrap, .auth-submit, input, select, textarea,
  tbody tr {
    transition-duration: 150ms !important;
    transition-timing-function: ease-out !important;
  }

  .card:hover, .pi:hover:not(:disabled), #sb a:hover,
  .btn:hover:not(:disabled), .ib:hover:not(:disabled), #bn a:hover,
  #bn button:hover {
    transform: none !important;
    filter: none !important;
  }

  .card, .pi {
    box-shadow: 0 4px 14px rgba(20, 35, 60, .055),
      inset 0 1px 0 rgba(255,255,255,.42) !important;
  }

  :root[data-theme="dark"] .card,
  :root[data-theme="dark"] #sb,
  :root[data-theme="dark"] header,
  :root[data-theme="dark"] #bn,
  :root[data-theme="dark"] .mc {
    box-shadow: 0 5px 16px rgba(0,0,0,.22),
      inset 0 1px 0 rgba(255,255,255,.035) !important;
  }

  /* Animate the page container once, instead of animating dozens of cards. */
  #view > * {
    animation: none !important;
  }
  #view.is-view-entering {
    animation: apexMobilePageIn 170ms ease-out both;
  }
  #view.is-view-entering > *,
  #view.is-view-entering .stats .card,
  #view.is-view-entering .g2 > .card,
  #view.is-view-entering .g3 > .card {
    animation: none !important;
    filter: none !important;
  }
  @keyframes apexMobilePageIn {
    from { opacity: .82; transform: translate3d(0, 6px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }

  /* Quick app reveal after login: compositor-friendly opacity and transform only. */
  body.apex-app-entering #sb {
    animation: apexMobileSidebarIn 180ms ease-out both;
  }
  body.apex-app-entering #main {
    animation: apexMobileWorkspaceIn 190ms 25ms ease-out both;
  }
  body.apex-app-entering header,
  body.apex-app-entering #bn {
    animation: apexMobileWorkspaceIn 170ms 45ms ease-out both;
  }
  body.apex-app-entering #view > * {
    animation: none !important;
  }
  body.apex-app-entering #view {
    animation: apexMobilePageIn 180ms 55ms ease-out both;
  }
  @keyframes apexMobileSidebarIn {
    from { opacity: .8; transform: translate3d(-8px, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  @keyframes apexMobileWorkspaceIn {
    from { opacity: .8; transform: translate3d(0, 7px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }

  /* Remove continuously moving decorative layers on low-power touch devices. */
  #auth-screen::before,
  .auth-brand::after,
  .auth-orb-one,
  .auth-orb-two {
    animation: none !important;
  }
  .auth-orb-one, .auth-orb-two { transform: none !important; }
  .auth-shell {
    box-shadow: 0 16px 42px rgba(20,35,60,.12),
      inset 0 1px 0 rgba(255,255,255,.82) !important;
    transition: box-shadow 160ms ease, border-color 160ms ease !important;
  }
  #auth-screen[data-auth-theme="dark"] .auth-shell {
    box-shadow: 0 18px 44px rgba(0,0,0,.38),
      inset 0 1px 0 rgba(255,255,255,.06) !important;
  }
  .auth-shell.is-mode-changing .auth-panel {
    animation: apexMobileAuthQuickIn 170ms ease-out both !important;
    filter: none !important;
  }
  @keyframes apexMobileAuthQuickIn {
    from { opacity: .78; transform: translate3d(0, 7px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  .auth-shell.is-entering,
  .auth-shell.is-returning {
    animation-duration: 190ms !important;
    filter: none !important;
  }
  #auth-screen.is-exiting {
    animation: apexMobileAuthOut 190ms ease-in both !important;
  }
  #auth-screen.is-exiting .auth-shell {
    animation: apexMobileAuthOut 180ms ease-in both !important;
  }
  @keyframes apexMobileAuthOut {
    to { opacity: 0; transform: translate3d(0, -6px, 0) scale(.99); }
  }

  /* Small, fast overlays and feedback. */
  #modal.is-opening .mb {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  #toasts .ts {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    animation-duration: 180ms !important;
  }
  #toasts .ts.is-leaving { animation-duration: 130ms !important; }
  .apex-ripple { display: none !important; }

  html.is-theme-transitioning,
  html.is-theme-transitioning body,
  html.is-theme-transitioning body * {
    transition-duration: 130ms !important;
  }
}

/* On any touch-first device, skip hover decoration that can stick after a tap. */
@media (hover: none), (pointer: coarse) {
  .btn.p::after, .auth-submit::after { display: none !important; }
  .pi:hover .th { transform: none !important; filter: none !important; }
}

/* Desktop brand sweep is also shorter; touch devices skip it entirely. */
@media (min-width: 801px) {
  .auth-shell.is-sweeping .auth-transition-blade {
    animation-duration: 520ms !important;
  }
  .auth-shell.is-entering,
  .auth-shell.is-entering .auth-brand-copy,
  .auth-shell.is-entering .auth-brand-top,
  .auth-shell.is-entering .auth-brand-foot,
  .auth-shell.is-entering .auth-panel {
    animation-duration: 300ms !important;
  }
}

/* APEX KASIR — Dark Mode mobile: hilangkan seluruh kartu pembungkus login.
   Override diletakkan di stylesheet terakhir agar tidak tertimpa oleh aturan
   tema sebelumnya. Permukaan input dan tombol tetap dipertahankan. */
@media (max-width: 800px) {
  #auth-screen[data-auth-theme="dark"] .auth-shell,
  #auth-screen[data-auth-theme="dark"] .auth-panel-wrap,
  #auth-screen[data-auth-theme="dark"] .auth-panel {
    border: 0 !important;
    outline: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  #auth-screen[data-auth-theme="dark"] .auth-panel {
    padding: 0 !important;
  }

  #auth-screen[data-auth-theme="dark"] .auth-shell::before,
  #auth-screen[data-auth-theme="dark"] .auth-shell::after,
  #auth-screen[data-auth-theme="dark"] .auth-panel-wrap::before,
  #auth-screen[data-auth-theme="dark"] .auth-panel-wrap::after,
  #auth-screen[data-auth-theme="dark"] .auth-panel::before,
  #auth-screen[data-auth-theme="dark"] .auth-panel::after {
    content: none !important;
    display: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}
