/* ---------- CopyCenter POS Custom CSS (FULL RESPONSIVE: Mobile → Desktop) ---------- */
html,
body {
  scroll-behavior: smooth;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Scrollbar Custom ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---------- Animasi ---------- */
@keyframes softPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}
.pulse,
[class*="animate-pulse"] {
  animation: softPulse 1.6s ease-in-out infinite;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Number Input (hide spinner) ---------- */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* ---------- Transition Global ---------- */
.transition {
  transition: all 0.2s ease-in-out;
}

/* ---------- Sidebar Mobile (Off-Canvas Drawer) ---------- */
#sidebarOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#sidebarOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

aside {
  z-index: 45;
}
aside.mobile-open {
  animation: slideInLeft 0.28s ease-out forwards;
}

/* ---------- Tabel wrapper (WAJIB scroll horizontal di mobile) ---------- */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 var(--tw-rounded-xl, 0.75rem) var(--tw-rounded-xl, 0.75rem);
}
.table-scroll table {
  min-width: 640px;
}

/* ---------- Login Page responsive ---------- */
@media (max-width: 480px) {
  #loginPage > div {
    padding: 1.5rem 1.25rem;
  }
}

/* ---------- Header responsive: sempit = hide subtitle ---------- */
@media (max-width: 640px) {
  .header-subtitle {
    display: none;
  }
  .user-display-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---------- Modal (full-width mobile) ---------- */
@media (max-width: 480px) {
  [id$="Modal"] > div {
    border-radius: 1rem 1rem 0 0 !important;
    margin-top: auto;
    width: 100% !important;
    max-width: 100% !important;
  }
  [id$="Modal"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  [id$="Modal"] [class*="p-6"],
  [id$="Modal"] [class*="p-5"] {
    padding: 1.1rem !important;
  }
  [id$="Modal"] [class*="space-y-"] > * + * {
    margin-top: 0.75rem !important;
  }
  [id$="Modal"] [class*="gap-4"] {
    gap: 0.75rem !important;
  }
}

/* ---------- Utility: hide scrollbar untuk horizontal list ---------- */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---------- Touch-friendly (min 44px tap area mobile) ---------- */
button,
.sb-item,
[role="button"] {
  min-height: 40px;
}
@media (max-width: 640px) {
  button {
    min-height: 44px;
  }
  .sb-item {
    min-height: 46px;
  }
  input,
  select {
    min-height: 46px;
  }
}

/* ---------- Safe area untuk mobile notch (iOS/Android 10+) ---------- */
@supports (padding: max(0px)) {
  #loginPage,
  #dashboardPage {
    padding-left: min(0vmin, env(safe-area-inset-left));
    padding-right: min(0vmin, env(safe-area-inset-right));
  }
}

.loading-cursor {
  cursor: progress;
}
