/* ===================================================
   NAJWA KASIR â€” Design System
   Mobile-first, Dark Mode, Premium POS UI
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* â”€â”€â”€ CSS Variables â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
  /* Backgrounds */
  --bg-app:      #0B0F1A;
  --bg-card:     #141927;
  --bg-elevated: #1C2333;
  --bg-overlay:  #232B3E;
  --bg-input:    #0F1420;

  /* Brand / Accent */
  --accent:        #4F81FF;
  --accent-hover:  #3A6AE8;
  --accent-glow:   rgba(79, 129, 255, 0.25);
  --accent-light:  rgba(79, 129, 255, 0.12);

  /* Status */
  --success:       #22C55E;
  --success-light: rgba(34, 197, 94, 0.15);
  --danger:        #F05252;
  --danger-light:  rgba(240, 82, 82, 0.15);
  --warning:       #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.15);
  --info:          #06B6D4;
  --info-light:    rgba(6, 182, 212, 0.15);

  /* Text */
  --text-primary:   #F1F5FF;
  --text-secondary: #8B96B0;
  --text-muted:     #5A6478;
  --text-inverse:   #0B0F1A;

  /* Border */
  --border:        rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-accent: 0 4px 20px var(--accent-glow);

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.12s ease;
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Nav */
  --nav-height-mobile: 64px;
  --nav-width-desktop: 240px;

  /* Z-index layers */
  --z-nav:    100;
  --z-modal:  200;
  --z-toast:  300;
}

/* â”€â”€â”€ Reset & Base â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, button, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* â”€â”€â”€ Scrollbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-overlay); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* â”€â”€â”€ App Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Main content area */
.main-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-md);
  padding-bottom: calc(var(--nav-height-mobile) + var(--space-md));
}

/* â”€â”€â”€ Sidebar Navigation (Desktop) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar {
  display: none; /* hidden on mobile */
  width: var(--nav-width-desktop);
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex-direction: column;
  z-index: var(--z-nav);
}

.sidebar-logo {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #A78BFA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.sidebar-logo .logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-user {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-sm);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  width: 100%;
  border: 0;
  color: inherit;
  text-align: left;
}

.user-profile-trigger { cursor: pointer; transition: var(--transition); }
.user-profile-trigger { font: inherit; }
.user-profile-trigger:hover { background: var(--accent-light); }
.user-profile-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.user-info { min-width: 0; }
.user-cabang span { display: block; }
.user-default-sales {
  margin-top: 3px;
  color: var(--accent);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-session-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 20);
  display: grid;
  place-items: center;
  padding: var(--space-md);
}
.profile-session-modal[hidden] { display: none; }
.profile-session-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.profile-session-dialog {
  position: relative;
  width: min(94vw, 460px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: 0 28px 80px rgba(0,0,0,.45);
  animation: slideUp .2s ease;
}
.profile-session-head,
.profile-session-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
}
.profile-session-head { border-bottom: 1px solid var(--border); }
.profile-session-head h2 { margin: 2px 0 0; font-size: 1.1rem; }
.profile-session-eyebrow {
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.profile-session-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.7rem;
  cursor: pointer;
}
.profile-session-close:hover { background: var(--bg-card); color: var(--text-primary); }
.profile-session-body { padding: var(--space-lg); }
.profile-session-account {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.profile-session-account strong,
.profile-session-account span { display: block; }
.profile-session-account span { margin-top: 2px; color: var(--text-muted); font-size: .76rem; }
.profile-session-hint { margin: 8px 0 0; color: var(--text-muted); font-size: .74rem; line-height: 1.5; }
.profile-session-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
body.profile-session-open { overflow: hidden; }

@media (max-width: 575px) {
  .profile-session-modal { place-items: end center; padding: 0; }
  .profile-session-dialog { width: 100%; border-width: 1px 0 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .profile-session-actions { padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom)); }
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), #A78BFA);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: white;
}

.user-info .user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-info .user-cabang {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-sm) var(--space-sm);
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--space-sm) var(--space-sm) var(--space-xs);
  margin-top: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-item svg { 
  width: 18px; 
  height: 18px; 
  flex-shrink: 0; 
  opacity: 0.8;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover { background: var(--danger-light); }
.btn-logout svg { width: 18px; height: 18px; }

/* â”€â”€â”€ Bottom Navigation (Mobile) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height-mobile);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: var(--z-nav);
  padding: 0 var(--space-xs);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  flex: 1;
  max-width: 80px;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  transition: var(--transition);
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item.active svg {
  transform: scale(1.1);
}

/* Kasir / POS button â€” center highlight */
.bottom-nav-item.nav-kasir {
  position: relative;
}

.bottom-nav-item.nav-kasir .nav-icon-wrap {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), #A78BFA);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  margin-top: -20px;
  transition: var(--transition);
}

.bottom-nav-item.nav-kasir .nav-icon-wrap svg {
  width: 22px;
  height: 22px;
  color: white;
}

.bottom-nav-item.nav-kasir:hover .nav-icon-wrap,
.bottom-nav-item.nav-kasir.active .nav-icon-wrap {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(79, 129, 255, 0.45);
}

.bottom-nav-item.nav-kasir span { color: var(--text-secondary); font-size: 0.62rem; }
.bottom-nav-item.nav-kasir.active span { color: var(--accent); }

/* â”€â”€â”€ Top Bar (Mobile pages header) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding: var(--space-xs) 0;
}

.topbar-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.topbar-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* â”€â”€â”€ Cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: var(--transition);
}

.card:hover { border-color: var(--border-strong); }

.card-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

/* â”€â”€â”€ Stat Cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-color, var(--accent));
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--stat-bg, var(--accent-light));
  color: var(--stat-color, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.stat-icon svg { width: 18px; height: 18px; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }
.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-top: 2px;
  line-height: 1.2;
}
.stat-value.lg { font-size: 1rem; }

/* â”€â”€â”€ Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6366F1);
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover { box-shadow: 0 6px 24px var(--accent-glow); filter: brightness(1.08); }

.btn-success {
  background: linear-gradient(135deg, var(--success), #16A34A);
  color: white;
  box-shadow: 0 4px 16px rgba(34,197,94,0.25);
}

.btn-success:hover { filter: brightness(1.08); }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(240,82,82,0.25);
}

.btn-danger:hover { background: var(--danger); color: white; }

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--bg-overlay); color: var(--text-primary); }

.btn-sm { padding: 7px 12px; font-size: 0.8rem; }
.btn-lg { padding: 13px 24px; font-size: 0.95rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 9px; }
.btn-icon svg { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* â”€â”€â”€ Forms / Inputs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.form-group { margin-bottom: var(--space-md); }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 11px var(--space-md);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .form-control { padding-left: 42px; }
.input-group .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.input-group .input-addon-right {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 11px var(--space-md);
  outline: none;
  transition: var(--transition);
  cursor: pointer;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235A6478'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* â”€â”€â”€ Search Input â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.search-wrap {
  position: relative;
  margin-bottom: var(--space-md);
}

.search-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 12px 44px 12px 44px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-input);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 17px; height: 17px;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 20px; height: 20px;
  cursor: pointer;
  display: none;
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
  align-items: center;
  justify-content: center;
  border: none;
  padding: 2px;
}

.search-input:not(:placeholder-shown) + .search-icon + .search-clear,
.search-clear.visible { display: flex; }

/* â”€â”€â”€ Badges â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-accent  { background: var(--accent-light);   color: var(--accent); }
.badge-success { background: var(--success-light);  color: var(--success); }
.badge-danger  { background: var(--danger-light);   color: var(--danger); }
.badge-warning { background: var(--warning-light);  color: var(--warning); }
.badge-muted   { background: var(--bg-elevated);    color: var(--text-secondary); }

/* â”€â”€â”€ Toast Notifications â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.toast-container {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 240px;
  max-width: 340px;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
  border-left: 3px solid var(--accent);
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon   { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }

.toast.hide { animation: slideOutRight 0.25s ease forwards; }

/* â”€â”€â”€ Modal / Drawer â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: calc(var(--z-modal) - 1);
  backdrop-filter: blur(4px);
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

.modal {
  position: fixed;
  z-index: var(--z-modal);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* Bottom drawer (mobile default) */
.drawer {
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-lg);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 92vh;
  overflow-y: auto;
}

.drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-lg);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

/* â”€â”€â”€ Tables â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.table th {
  text-align: left;
  padding: 10px var(--space-md);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 13px var(--space-md);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: var(--transition-fast); }
.table tbody tr:hover td { background: var(--bg-elevated); }

/* â”€â”€â”€ Divider â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-md) 0;
}

/* â”€â”€â”€ Empty State â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-muted);
}

.empty-state svg { 
  width: 48px; height: 48px; 
  margin: 0 auto var(--space-md); 
  opacity: 0.35;
  color: var(--text-secondary);
}

.empty-state p { font-size: 0.9rem; }

/* â”€â”€â”€ Loading Spinner â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,15,26,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

/* â”€â”€â”€ Login Page â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: var(--bg-app);
  position: relative;
  overflow: hidden;
}

.login-bg-blur {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  pointer-events: none;
}

.login-bg-blur.b1 { background: var(--accent); top: -100px; right: -100px; }
.login-bg-blur.b2 { background: #A78BFA; bottom: -100px; left: -100px; }

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-logo-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--accent), #A78BFA);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  box-shadow: var(--shadow-accent);
}

.login-logo-icon svg { width: 30px; height: 30px; color: white; }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.login-logo p { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

.login-error {
  background: var(--danger-light);
  border: 1px solid rgba(240,82,82,0.25);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.login-error svg { width: 16px; height: 16px; flex-shrink: 0; }

/* â”€â”€â”€ Dashboard â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.quick-action-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.qa-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-xs);
}

.qa-icon svg { width: 20px; height: 20px; }
.qa-label { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.qa-desc { font-size: 0.7rem; color: var(--text-muted); }

/* â”€â”€â”€ Transaction List Items â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.trx-list { display: flex; flex-direction: column; gap: var(--space-sm); }

.trx-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.trx-item:hover { border-color: var(--accent); background: var(--bg-overlay); }

.trx-item-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trx-item-icon svg { width: 18px; height: 18px; }

.trx-item-info { flex: 1; min-width: 0; }
.trx-item-id { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.trx-item-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.trx-item-amount { font-size: 0.9rem; font-weight: 700; color: var(--success); white-space: nowrap; }

/* â”€â”€â”€ POS / Kasir â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.pos-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  height: calc(100vh - var(--nav-height-mobile) - 90px);
}

.pos-search-results {
  flex: 1;
  overflow-y: auto;
  border-radius: var(--radius-lg);
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.product-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.product-card:hover, .product-card:active {
  border-color: var(--accent);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

.product-card:active { transform: scale(0.97); }

.product-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  display: inline-block;
  margin-bottom: var(--space-xs);
  font-family: monospace;
}

.product-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.product-stok {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.product-stok.low { color: var(--warning); }
.product-stok.out { color: var(--danger); }

/* Cart FAB */
.cart-fab {
  position: fixed;
  bottom: calc(var(--nav-height-mobile) + 16px);
  right: var(--space-md);
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), #6366F1);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  cursor: pointer;
  border: none;
  z-index: 90;
  transition: var(--transition);
}

.cart-fab:hover { transform: scale(1.08); box-shadow: 0 8px 32px var(--accent-glow); }
.cart-fab:active { transform: scale(0.95); }
.cart-fab svg { width: 24px; height: 24px; color: white; }

.cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 20px; height: 20px;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg-app);
}

/* Cart Items */
.cart-items { display: flex; flex-direction: column; gap: var(--space-sm); }

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.cart-item-price { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.qty-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-overlay);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.qty-btn:hover { background: var(--accent); border-color: var(--accent); }
.qty-input {
  width: 40px;
  text-align: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px;
  outline: none;
}

.cart-item-subtotal {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
  margin-top: 6px;
}

.cart-item-del {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.cart-item-del:hover { color: var(--danger); background: var(--danger-light); }
.cart-item-del svg { width: 15px; height: 15px; }

/* Keyboard-selectable customer and sales search results. */
.lookup-option {
  display: flex;
  width: 100%;
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  padding: 10px var(--space-md);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.lookup-option:last-child { border-bottom: 0; }
.lookup-option:hover,
.lookup-option.selected,
.lookup-option:focus-visible { background: var(--bg-overlay); outline: none; }
.lookup-option-title { font-size: 0.85rem; font-weight: 600; }
.lookup-option-meta { font-size: 0.72rem; color: var(--text-muted); }

/* Discount row */
.discount-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.discount-row .form-control { max-width: 80px; text-align: right; }

/* Payment summary */
.payment-summary {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border: 1px solid var(--border);
}

.pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.875rem;
}

.pay-row .label { color: var(--text-secondary); }
.pay-row .value { font-weight: 600; color: var(--text-primary); }
.pay-row.total { 
  border-top: 1px solid var(--border); 
  margin-top: 8px; padding-top: 12px;
}

.pay-row.total .label { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.pay-row.total .value { font-size: 1.15rem; color: var(--accent); font-weight: 800; }
.pay-row.kembalian .value { color: var(--success); font-weight: 700; }

/* Payment methods */
.payment-methods {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.pay-method-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.pay-method-btn.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* â”€â”€â”€ Struk / Receipt â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.struk-container {
  max-width: 380px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
}

.struk-header {
  background: linear-gradient(135deg, var(--accent), #6366F1);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  color: white;
}

.struk-body { padding: var(--space-md); }

.struk-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
}

.struk-row:last-child { border-bottom: none; }
.struk-row .item-name { flex: 1; color: var(--text-secondary); }
.struk-row .item-qty  { color: var(--text-muted); margin: 0 var(--space-sm); }
.struk-row .item-price { font-weight: 600; color: var(--text-primary); }
.struk-total { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 2px solid var(--border); }

/* â”€â”€â”€ Laporan â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.period-tabs {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 2px;
  margin-bottom: var(--space-md);
}

.period-tab {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  transition: var(--transition);
}

.period-tab.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* â”€â”€â”€ Pelanggan / Customer â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.customer-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: var(--transition);
}

.customer-item:hover { border-color: var(--accent); }

.customer-avatar {
  width: 42px; height: 42px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #4F81FF22, #A78BFA22);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  flex-shrink: 0;
}

.customer-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.customer-info { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Pelanggan */
.pelanggan-toolbar { display: flex; align-items: center; gap: var(--space-md); }
.pelanggan-search { flex: 1; margin: 0; }
.pelanggan-result-meta { color: var(--text-muted); font-size: .78rem; white-space: nowrap; }
.pelanggan-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pelanggan-grid .customer-item { margin: 0; min-width: 0; }
.customer-main { display: block; flex: 1; min-width: 0; }
.customer-main > span, .customer-address { display: block; }
.customer-address {
  color: var(--text-muted);
  font-size: .72rem;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customer-id {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 4px 8px;
}
.customer-edit-icon { color: var(--text-muted); flex-shrink: 0; font-size: 1.35rem; line-height: 1; }
.pelanggan-more { display: flex; justify-content: center; padding: var(--space-lg) 0 var(--space-sm); }
.pelanggan-more .btn { min-width: 190px; }
.pelanggan-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); }
.pelanggan-modal-head .modal-title { margin-bottom: 2px; }
.pelanggan-modal-sub { color: var(--text-muted); font-size: .72rem; margin-bottom: var(--space-md); }
.pelanggan-modal-close {
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: 36px;
  justify-content: center;
  width: 36px;
}
.pelanggan-modal-close svg { width: 18px; }
.pelanggan-form-grid { display: grid; grid-template-columns: 1fr; gap: 0 var(--space-md); }
.pelanggan-form-actions {
  background: var(--bg-card);
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
  padding-top: var(--space-sm);
  position: sticky;
  bottom: 0;
}

/* â”€â”€â”€ Pagination â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* â”€â”€â”€ Animations â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp   { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight  { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes pulse     { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.fade-in   { animation: fadeIn 0.25s ease; }
.slide-up  { animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* â”€â”€â”€ Utilities â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm    { gap: var(--space-sm); }
.gap-md    { gap: var(--space-md); }
.flex-1    { flex: 1; }
.text-muted    { color: var(--text-muted); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-accent   { color: var(--accent); }
.text-sm   { font-size: 0.85rem; }
.text-xs   { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.mt-sm     { margin-top: var(--space-sm); }
.mt-md     { margin-top: var(--space-md); }
.mb-sm     { margin-bottom: var(--space-sm); }
.mb-md     { margin-bottom: var(--space-md); }
.hidden    { display: none !important; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* â”€â”€â”€ Responsive: Desktop â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (min-width: 768px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }

  .main-content {
    padding: var(--space-xl);
    padding-bottom: var(--space-xl);
    max-width: calc(100vw - var(--nav-width-desktop));
  }

  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .payment-methods { flex-wrap: nowrap; }

  /* Desktop POS: split layout */
  .pos-desktop-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-md);
    height: calc(100vh - 140px);
  }
  .pos-left  { display: flex; flex-direction: column; overflow: hidden; }
  .pos-right { 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    border-radius: var(--radius-xl); 
    padding: var(--space-md); 
    display: flex; 
    flex-direction: column;
    overflow: hidden;
  }
  
  .cart-fab { display: none; }
  .cart-panel-mobile { display: none; }
  .cart-panel-desktop { 
    display: flex !important; 
    flex-direction: column; 
    flex: 1; 
    overflow: hidden;
  }

  .drawer { 
    position: relative; 
    border-radius: 0; 
    padding: 0; 
    animation: none; 
    background: none;
    border: none;
    max-height: unset;
  }

  .modal { position: fixed; }
  .drawer-handle { display: none; }
}

/* --- Print Styles (Struk) ------------------------- */
@media print {
  body { background: white; color: black; }
  .bottom-nav, .sidebar, .btn, .topbar { display: none !important; }
  .main-content { padding: 0; }
  .struk-container { border: none; box-shadow: none; max-width: 100%; }
  .struk-header { background: #333 !important; -webkit-print-color-adjust: exact; }
}

/* Scan Mode Toggle */
.scan-mode-toggle {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-sm);
    padding: 4px;
    gap: 4px;
}
.scan-mode-toggle input[type="radio"] {
    display: none;
}
.scan-mode-toggle label {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 4px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
.scan-mode-toggle input[type="radio"]:checked + label {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* Manual Qty Input Overlay */
.manual-qty-card {
    background: var(--bg-elevated);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-top: var(--space-sm);
    animation: fadeIn 0.2s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* --- Desktop Only Redesign (Top/Bottom, Dense Tabular POS) --- */
@media (min-width: 1200px) {
  body { overflow: hidden; }

  /* â”€â”€ 3-row layout: [pay header] / [search bar] / [cart table] â”€â”€ */
  .main-content {
    position: relative;
    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "pay"
      "search"
      "cart";
    gap: var(--space-sm);
    padding: var(--space-sm) !important;
    height: 100vh;
    box-sizing: border-box;
    max-width: calc(100vw - var(--nav-width-desktop));
  }

  .pos-desktop-layout { display: contents; }
  .topbar { display: none !important; }

  /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
     ROW 1 â€” Transaction header (payDrawer as inline row)
  â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
  #payDrawer {
    grid-area: pay;
    display: flex !important;
    flex-direction: row;
    align-items: flex-end;
    gap: var(--space-md);
    position: relative !important;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    width: 100%;
    transform: none !important;
    z-index: 100 !important;
    overflow: visible !important;  /* allow pelanggan & sales dropdowns to show */
  }

  /* Hide drawer-only elements */
  #payDrawer .drawer-handle,
  #payDrawer .modal-title,
  #payDrawer .payment-summary,
  #payDrawer #metodeGroup,
  #payDrawer #bayarGroup,
  #payDrawer #tempoGroup {
    display: none !important;
  }

  /* Compact form inside pay header */
  #payDrawer .form-group {
    margin-bottom: 0 !important;
    flex: 1;
    position: relative;  /* so pelanggan/sales dropdowns can anchor */
  }
  #payDrawer .form-label {
    font-size: 0.72rem;
    margin-bottom: 2px;
    white-space: nowrap;
    color: var(--text-muted);
  }
  #payDrawer .form-control,
  #payDrawer .form-select {
    height: 30px;
    font-size: 0.82rem;
    padding: 0 8px;
  }
  #payDrawer .input-group .form-control {
    padding-left: 34px !important;
  }
  #payDrawer .input-group .input-icon {
    left: 10px !important;
    width: 15px !important;
    height: 15px !important;
  }

  /* Diskon+Ongkir grid â†’ horizontal flex */
  #payDrawer #transactionAdjustments {
    display: flex !important;
    gap: var(--space-md);
    flex: 2;
  }

  #payDrawer .pos-field-customer { order: 1; }
  #payDrawer .pos-field-sales { order: 2; }
  #payDrawer #transactionAdjustments { order: 3; }

  /* Pelanggan Results dropdown â€“ anchor to its parent form-group */
  #payDrawer #inputSales { display: none !important; }
  #payDrawer .sales-desktop-wrap { display: block !important; }

  #payDrawer #pelangganResults,
  #payDrawer #salesResults {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9000;
    background: var(--bg-elevated);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
  }
  #payDrawer #selectedPelanggan,
  #payDrawer #selectedSales {
    position: static !important;
    margin-top: 0 !important;
    height: 32px;
    padding: 0 12px !important;
  }
  #payDrawer #errPelanggan,
  #payDrawer #errSales {
    position: absolute;
    top: 100%;
    left: 0;
    font-size: 0.72rem;
    white-space: nowrap;
    z-index: 8998;
  }

  /* "Simpan Transaksi" fixed over placeholder */
  #btnSimpan {
    position: fixed;
    bottom: var(--space-md);
    right: var(--space-md);
    width: 240px;
    height: 50px;
    margin: 0 !important;
    z-index: 999;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    border-radius: var(--radius-md);
  }

  /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
     ROW 2 â€” Search bar (pos-left, fixed-height strip)
  â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
  .pos-left {
    grid-area: search;
    /* Fixed height â€“ never expands to avoid shifting cart row */
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    position: relative !important;   /* anchor for dropdown below */
    overflow: visible !important;    /* let dropdown bleed out */
    z-index: 90 !important;
  }

  .pos-left .search-wrap {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: 0 !important;
    position: relative;   /* anchor for dropdown */
  }

  .scan-mode-toggle {
    width: 280px;
    flex-shrink: 0;
    margin-bottom: 0 !important;
  }

  .pos-left .search-input {
    height: 38px;
    font-size: 1rem;
  }

  /* â”€â”€ Product search dropdown (floating, won't shift layout) â”€â”€ */
  #searchResultsWrap {
    display: none;          /* shown via JS */
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-elevated);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    max-height: 380px;
    overflow-y: auto;
  }

  /* Manual-qty card inherits the wrap styling */
  .manual-qty-card {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .search-dropdown-list {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
  }

  .sdi-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
  }
  .sdi-item:last-child { border-bottom: none; }
  .sdi-item:hover,
  .sdi-item.selected { background: var(--bg-overlay); }
  .sdi-item.disabled { opacity: 0.5; cursor: not-allowed; }
  .sdi-item.disabled:hover,
  .sdi-item.disabled.selected { background: transparent; }

  .sdi-left { display: flex; flex-direction: column; }
  .sdi-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
  .sdi-barcode { font-size: 0.72rem; color: var(--text-muted); font-family: monospace; margin-top: 2px; }
  .sdi-right { display: flex; flex-direction: column; align-items: flex-end; }
  .sdi-price { font-weight: 700; font-size: 0.9rem; color: var(--accent); }
  .sdi-stock { font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,0.08); margin-top: 4px; }
  .sdi-stock.out { color: var(--danger); background: rgba(239,68,68,0.1); }
  .sdi-stock.low { color: var(--warning); background: rgba(245,158,11,0.1); }

  /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
     ROW 3 â€” Cart table (pos-right, fills remaining height)
  â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
  .pos-right {
    grid-area: cart;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0;
    overflow: hidden;
    min-height: 0; /* critical: allows flex child to shrink below content height */
  }

  /* Hide the mobile "Keranjang" label at top */
  .pos-right > div:first-child { display: none; }

  /* Un-wrap cart-item-info so children sit directly in the grid */
  .cart-item-info,
  .cart-item-info > div:last-child { display: contents !important; }

  #cartItemsDesktop {
    flex: 1;
    overflow-y: auto;   /* â† scrollable cart list */
    margin-bottom: 0 !important;
    background: var(--bg-app);
    min-height: 0;      /* critical: flex child must be able to shrink */
  }

  /* Sticky table header */
  .desktop-table-header {
    display: grid !important;
    grid-template-columns: 2.5fr 150px 150px 150px 50px;
    padding: 6px 14px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    background: var(--bg-elevated);
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  /* Dense tabular rows */
  .pos-right .cart-item {
    display: grid !important;
    grid-template-columns: 2.5fr 150px 150px 150px 50px;
    align-items: center;
    padding: 0 14px !important;
    height: 38px;
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 0 !important;
    background: var(--bg-card) !important;
    gap: var(--space-sm) !important;
    margin: 0 !important;
  }
  .pos-right .cart-item:nth-child(even) { background: rgba(255,255,255,0.015) !important; }
  .pos-right .cart-item:hover { background: rgba(255,255,255,0.04) !important; }
  .pos-right .cart-item.is-marked {
    background: rgba(79, 129, 255, 0.14) !important;
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .pos-right .cart-item.is-marked .cart-item-name::before {
    content: '✓';
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
  }
  .pos-right .cart-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

  /* Column order */
  .pos-right .cart-item-name     { order: 1; }
  .pos-right .cart-item-controls { order: 2; }
  .pos-right .cart-item-price    { order: 3; }
  .pos-right .cart-item-subtotal { order: 4; }
  .pos-right .cart-item-del      { order: 5; }

  .pos-right .cart-item-name {
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pos-right .cart-item-price {
    font-size: 0.78rem !important;
    color: var(--text-secondary) !important;
    margin-top: 0 !important;
    text-align: right;
  }
  .pos-right .cart-item-controls { justify-content: center; }
  .pos-right .qty-btn  { width: 24px; height: 24px; }
  .pos-right .qty-input { height: 24px; font-size: 0.8rem; width: 42px; text-align: center; }
  .pos-right .cart-item-subtotal {
    font-size: 0.88rem !important;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
  }
  .pos-right .cart-item-del {
    width: 28px !important;
    height: 28px !important;
    margin: 0 auto !important;
    background: transparent !important;
    color: var(--text-muted);
  }
  .pos-right .cart-item-del:hover { color: var(--danger); }

  /* â”€â”€ Footer / summary bar â”€â”€ */
  .pos-right #cartFooterDesktop {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 64px;
    gap: var(--space-md);
    padding: 8px var(--space-md) !important;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    margin-top: 0 !important;
  }
  .pos-right #cartFooterDesktop .divider { display: none; }

  .pos-right #btnClearCartDesktop {
    order: 2;
    flex-shrink: 0;
    margin-right: auto;
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.35);
  }

  .pos-right #cartFooterDesktop #transactionAdjustments {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 8px;
    flex: 0 1 400px;
    min-width: 300px;
    margin-right: 0;
    order: 1;
  }
  .pos-right #cartFooterDesktop #transactionAdjustments .form-group { margin: 0 !important; }
  .pos-right #cartFooterDesktop #transactionAdjustments .form-label {
    margin-bottom: 2px;
    font-size: 0.68rem;
    white-space: nowrap;
  }
  .pos-right #cartFooterDesktop #transactionAdjustments .form-control {
    height: 30px;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  /* Invisible placeholder for the fixed-position "Simpan" btn */
  .pos-right #btnCheckout {
    visibility: hidden;
    width: 240px;
    height: 50px;
    margin: 0 !important;
    order: 4;
  }

  .pos-right .payment-summary {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
    margin: 0 var(--space-xl) 0 0 !important;
    order: 3;
  }
  .pos-right .payment-summary .pay-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .pos-right .payment-summary .pay-row .label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .pos-right .payment-summary .pay-row .value { font-size: 1.05rem; font-weight: 600; }
  .pos-right .payment-summary .pay-row.total .value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
  }
}

/* Web-only stock policy dialog. */
.stock-policy-modal {
  top: 50%;
  left: 50%;
  width: min(calc(100vw - 32px), 460px);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}
.stock-policy-note { margin: 0 0 var(--space-md); color: var(--text-secondary); font-size: 0.84rem; line-height: 1.5; }
.stock-policy-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.stock-policy-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.stock-policy-choice input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.stock-policy-choice span { display: grid; gap: 3px; }
.stock-policy-choice small { color: var(--text-secondary); line-height: 1.35; }
.stock-policy-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-lg); }

.settings-page { max-width: 980px; margin: 0 auto; }
.settings-page .topbar { margin-bottom: var(--space-lg); }
.settings-card {
  padding: clamp(18px, 3vw, 28px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.settings-card h2 { margin: 0 0 6px; font-size: 1.1rem; }
.settings-card + .settings-card { margin-top: var(--space-lg); }
.settings-section-head { display:flex;align-items:flex-start;justify-content:space-between;gap:16px; }
.settings-branch-badge { flex:none;padding:6px 10px;border:1px solid var(--border);border-radius:999px;color:var(--text-secondary);font-size:.75rem;font-weight:700; }
.nota-settings-layout { display:grid;grid-template-columns:180px minmax(0,1fr);gap:24px;margin-top:18px; }
.nota-logo-editor { display:flex;flex-direction:column;align-items:center;gap:9px; }
.nota-logo-preview { width:150px;aspect-ratio:1;display:grid;place-items:center;padding:8px;background:#fff;border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden; }
.nota-logo-preview img { width:100%;height:100%;object-fit:contain; }
.nota-logo-button { width:150px;justify-content:center;cursor:pointer; }
.nota-logo-editor small { color:var(--text-muted);font-size:.68rem;text-align:center;line-height:1.4; }
.nota-settings-fields { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px; }
.nota-settings-fields .form-group { margin:0;min-width:0; }
.nota-field-wide { grid-column:1 / -1; }
.nota-settings-fields textarea.form-control { min-height:72px; }
@media (max-width:700px) {
  .settings-section-head { align-items:center; }
  .nota-settings-layout { grid-template-columns:1fr;gap:18px; }
  .nota-settings-fields { grid-template-columns:1fr; }
  .nota-field-wide { grid-column:auto; }
  .nota-logo-editor { flex-direction:row;align-items:center;flex-wrap:wrap; }
  .nota-logo-preview { width:94px; }
  .nota-logo-button { width:auto; }
  .nota-logo-editor small { text-align:left;max-width:150px; }
}

.print-nota-option {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  width: max-content;
  margin: 8px 0 0 auto;
  padding: 2px 0;
  color: var(--text-secondary);
  font-size: .78rem;
  cursor: pointer;
}
.print-nota-option:has(input:checked) { color: var(--text-primary); }
.print-nota-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }

/* ===================================================
   UI foundation refresh — accessible mobile-first shell
   These final rules intentionally override legacy breakpoints above.
   =================================================== */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
.btn, .btn-logout, .nav-item, .bottom-nav-item { min-height: 44px; }
.form-control, .form-select { min-height: 44px; }
textarea.form-control { min-height: 96px; resize: vertical; }

/* Riwayat & edit transaksi */
.riwayat-filter-panel { overflow: visible; }
.riwayat-filter-head { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:var(--space-md); }
.riwayat-filter-head .card-title { margin:0; }
.riwayat-filter-hint { color:var(--text-muted);font-size:.72rem;margin-top:3px; }
.riwayat-filter-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-sm) var(--space-md);align-items:end; }
.riwayat-filter-grid .form-group { margin-bottom:0;min-width:0; }
.riwayat-sales-filter { grid-column:span 2; }
.riwayat-filter-actions { display:grid;grid-template-columns:1fr 1fr;gap:6px;align-items:end; }
.riwayat-list-hint { margin:-6px 0 10px;padding:0 2px;color:var(--text-muted);font-size:.68rem;text-align:right; }
.riwayat-hint-mobile { display:none; }
.trx-item-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.trx-item-wrap:last-child { border-bottom: 0; }
.trx-item-wrap .trx-item { flex: 1; border-bottom: 0; min-width: 0; }
.trx-item-wrap button.trx-item { width:100%;font:inherit;color:inherit;text-align:left;appearance:none;touch-action:manipulation; }
.trx-item-wrap.trx-selected {
  position:relative;border-color:var(--accent);border-radius:var(--radius-md);
  background:color-mix(in srgb,var(--accent) 9%,var(--bg-card));
  box-shadow:inset 3px 0 0 var(--accent),0 0 0 2px color-mix(in srgb,var(--accent) 16%,transparent);
}
.trx-item-wrap.trx-selected .trx-item { border-color:color-mix(in srgb,var(--accent) 65%,var(--border));background:transparent; }
.trx-item-wrap.trx-selected .trx-item-icon { box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 28%,transparent); }
.trx-item-wrap .trx-item:focus-visible { outline:2px solid var(--accent);outline-offset:2px; }
.trx-actions { display: flex; align-items: center; gap: 6px; padding: 8px 12px 8px 0; }
.trx-action-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary);
  background: var(--bg-elevated); cursor: pointer; text-decoration: none;
}
.trx-action-btn:hover { color: var(--accent); border-color: var(--accent); }
.trx-action-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.trx-action-btn svg { width: 17px; height: 17px; }
.trx-detail-mobile { display:none; }
.trx-readonly { font-size: .65rem; color: var(--text-muted); white-space: nowrap; }
.trx-item-id { display:flex;align-items:center;gap:6px;flex-wrap:wrap; }
.trx-item-context { font-size:.66rem;color:var(--text-muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.trx-branch-badge,.trx-status-badge { font-size:.6rem;padding:2px 6px; }
.badge-neutral { background:var(--bg-elevated);border:1px solid var(--border);color:var(--text-secondary); }
.page-ellipsis { color:var(--text-muted);padding:0 4px; }
.trx-item-wrap.trx-highlighted {
  position:relative;border:1px solid var(--accent);border-radius:var(--radius-md);
  background:color-mix(in srgb,var(--accent) 13%,var(--bg-card));
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 22%,transparent),0 12px 35px rgba(0,0,0,.24);
  animation:trx-highlight-pulse 1.2s ease-out 2;
}
.trx-item-wrap.trx-highlighted::before {
  content:'Baru diedit';position:absolute;z-index:2;left:12px;top:-11px;padding:3px 8px;
  border-radius:999px;background:var(--accent);color:white;font-size:.62rem;font-weight:700;letter-spacing:.02em;
}
.trx-item-wrap.trx-highlighted:focus { outline:2px solid var(--accent);outline-offset:4px; }
@keyframes trx-highlight-pulse {
  0%,100% { box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent),0 12px 35px rgba(0,0,0,.24); }
  50% { box-shadow:0 0 0 8px color-mix(in srgb,var(--accent) 8%,transparent),0 16px 45px rgba(37,99,235,.28); }
}

.riwayat-detail-open { overflow:hidden !important; }
.riwayat-detail-overlay {
  position:fixed;inset:0;z-index:calc(var(--z-modal) + 5);display:grid;place-items:center;
  padding:24px;background:rgba(3,7,18,.76);backdrop-filter:blur(5px);animation:fadeIn .18s ease;
}
.riwayat-detail-modal {
  display:flex;flex-direction:column;width:min(780px,calc(100vw - 48px));max-height:min(88dvh,820px);
  overflow:hidden;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-xl);
  box-shadow:0 28px 80px rgba(0,0,0,.48);animation:slideUp .22s ease;outline:0;
}
.riwayat-detail-head { display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 22px 16px;border-bottom:1px solid var(--border); }
.riwayat-detail-eyebrow { color:var(--accent);font-size:.65rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase; }
.riwayat-detail-head h2 { margin:3px 0 0;font-size:1.18rem;color:var(--text-primary);font-family:monospace; }
.riwayat-detail-date { margin-top:4px;color:var(--text-muted);font-size:.72rem; }
.riwayat-detail-close { display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border:1px solid var(--border);border-radius:10px;background:var(--bg-elevated);color:var(--text-secondary);font-size:1.5rem;line-height:1;cursor:pointer; }
.riwayat-detail-close:hover,.riwayat-detail-close:focus-visible { color:var(--danger);border-color:var(--danger);outline:0; }
.riwayat-detail-state { min-height:220px;display:flex;align-items:center;justify-content:center;gap:10px;padding:30px;color:var(--text-muted);font-size:.82rem; }
.riwayat-detail-error { color:var(--danger);text-align:center; }
.riwayat-detail-content { min-height:0;overflow-y:auto;padding:18px 22px;overscroll-behavior:contain; }
.riwayat-detail-info { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:16px; }
.riwayat-detail-info > div { min-width:0;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg-elevated); }
.riwayat-detail-info span:not(.badge) { display:block;margin-bottom:3px;color:var(--text-muted);font-size:.62rem;text-transform:uppercase;letter-spacing:.04em; }
.riwayat-detail-info strong { display:block;overflow:hidden;color:var(--text-primary);font-size:.78rem;text-overflow:ellipsis;white-space:nowrap; }
.riwayat-detail-items { border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden; }
.riwayat-detail-item { display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:10px;align-items:center;padding:11px 12px;border-bottom:1px solid var(--border); }
.riwayat-detail-item:last-child { border-bottom:0; }
.riwayat-detail-item-no { display:grid;place-items:center;width:24px;height:24px;border-radius:7px;background:var(--bg-elevated);color:var(--text-muted);font-size:.65rem; }
.riwayat-detail-item-info { min-width:0;display:flex;flex-direction:column;gap:3px; }
.riwayat-detail-item-info strong { overflow:hidden;color:var(--text-primary);font-size:.8rem;text-overflow:ellipsis;white-space:nowrap; }
.riwayat-detail-item-info span { color:var(--text-muted);font-size:.68rem; }
.riwayat-detail-item-total { color:var(--text-primary);font-size:.78rem;white-space:nowrap; }
.riwayat-detail-empty { padding:28px;text-align:center;color:var(--text-muted);font-size:.78rem; }
.riwayat-detail-totals { width:min(100%,350px);margin:14px 0 0 auto; }
.riwayat-detail-totals > div { display:flex;align-items:center;justify-content:space-between;gap:14px;padding:6px 2px;color:var(--text-secondary);font-size:.76rem; }
.riwayat-detail-grandtotal { margin-top:4px;padding-top:11px !important;border-top:1px solid var(--border);font-size:.9rem !important; }
.riwayat-detail-grandtotal strong { color:var(--accent);font-size:1.08rem; }
.riwayat-detail-readonly { margin-top:14px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg-elevated);color:var(--text-muted);font-size:.7rem; }
.riwayat-detail-actions { display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:14px 22px;border-top:1px solid var(--border);background:var(--bg-elevated); }
.riwayat-detail-actions #riwayatDetailDone { margin-right:auto; }
.riwayat-detail-actions .btn svg { width:17px;height:17px; }

.edit-sale-loading { display:flex;align-items:center;justify-content:center;gap:12px;padding:48px; }
.edit-sale-message { margin-bottom: var(--space-md); padding: 14px 16px; font-size: .86rem; }
.edit-sale-message-danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.edit-sale-message-warning { border-color: color-mix(in srgb, var(--warning) 45%, transparent); color: var(--warning); }
.edit-sale-layout { display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:var(--space-md);align-items:start; }
.edit-sale-main { display:grid;gap:var(--space-md);min-width:0; }
.edit-sale-card { padding:var(--space-lg);overflow:visible; }
.edit-sale-card-head { display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:var(--space-md); }
.edit-sale-card-head .card-title { margin:0; }
.edit-sale-hint { color:var(--text-muted);font-size:.74rem;margin-top:3px; }
.edit-sale-fields,.edit-payment-grid { display:grid;grid-template-columns:1fr 1fr;gap:var(--space-md); }
.edit-sale-fields .form-group,.edit-payment-grid .form-group { margin-bottom:0; }
.edit-search-field,.edit-product-search { position:relative; }
.edit-search-results {
  position:absolute;z-index:30;left:0;right:0;top:calc(100% + 4px);max-height:260px;overflow:auto;
  border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-elevated);
  box-shadow:0 18px 45px rgba(0,0,0,.32);padding:5px;
}
.edit-result-option { width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--text-primary);cursor:pointer;text-align:left; }
.edit-result-option span { color:var(--text-muted);font-size:.72rem; }
.edit-result-option:hover,.edit-result-option.active { background:var(--accent-light);color:var(--accent); }
.edit-result-empty { color:var(--text-muted);font-size:.8rem;padding:12px;text-align:center; }
.edit-product-search { margin-bottom:var(--space-md); }
.edit-items-list { display:grid;gap:6px; }
.edit-item-row { display:grid;grid-template-columns:minmax(180px,1fr) 132px 120px 36px;gap:12px;align-items:center;padding:11px 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-surface); }
.edit-item-row.stock-error { border-color:var(--danger); }
.edit-item-info { min-width:0;display:flex;flex-direction:column;gap:2px; }
.edit-item-info strong { white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.84rem; }
.edit-item-info span,.edit-item-info small { color:var(--text-muted);font-size:.7rem; }
.edit-item-qty { display:grid;grid-template-columns:34px 1fr 34px;align-items:center; }
.edit-item-qty button,.edit-item-qty input { height:34px;border:1px solid var(--border);background:var(--bg-elevated);color:var(--text-primary);text-align:center; }
.edit-item-qty button { cursor:pointer;font-weight:700;font-size:1rem; }
.edit-item-qty button:first-child { border-radius:7px 0 0 7px; }
.edit-item-qty button:last-child { border-radius:0 7px 7px 0; }
.edit-item-qty input { width:100%;border-left:0;border-right:0;outline:0; }
.edit-item-total { text-align:right;font-size:.84rem;white-space:nowrap; }
.edit-item-remove { width:34px;height:34px;border:0;background:transparent;color:var(--text-muted);cursor:pointer;border-radius:7px;display:grid;place-items:center; }
.edit-item-remove:hover { color:var(--danger);background:var(--danger-light); }
.edit-item-remove svg { width:17px;height:17px; }
.edit-sale-summary { position:sticky;top:16px;padding:var(--space-lg); }
.edit-summary-row { display:flex;justify-content:space-between;gap:12px;padding:9px 0;color:var(--text-secondary);font-size:.82rem; }
.edit-summary-row strong { color:var(--text-primary); }
.edit-summary-total { margin-top:5px;padding:14px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);font-size:1rem; }
.edit-summary-total strong { color:var(--accent);font-size:1.25rem; }
.edit-sale-actions { display:grid;gap:8px;margin-top:var(--space-lg); }
.edit-danger-note { color:var(--text-muted);font-size:.67rem;line-height:1.5;margin:10px 0 0; }

@media (min-width: 701px) {
  .page-riwayat #filterButton { display:none; }
  .page-riwayat .riwayat-filter-panel { display:block !important;padding:12px 14px;margin-bottom:12px; }
  .page-riwayat .riwayat-filter-head { display:none; }
  .page-riwayat .riwayat-filter-grid {
    grid-template-columns:minmax(100px,.9fr) 112px 112px 90px 120px 95px minmax(120px,1fr) 118px;
    gap:6px;align-items:end;
  }
  .page-riwayat .riwayat-sales-filter { grid-column:auto; }
  .page-riwayat .riwayat-filter-grid .form-label { font-size:.64rem;margin-bottom:3px; }
  .page-riwayat .riwayat-filter-grid .form-control,
  .page-riwayat .riwayat-filter-grid .form-select { min-height:36px;height:36px;padding-top:6px;padding-bottom:6px;font-size:.76rem; }
  .page-riwayat .riwayat-filter-actions .btn { min-height:36px;height:36px;padding:6px 8px;font-size:.7rem; }
}
@media (min-width: 701px) and (max-width: 1050px) {
  .page-riwayat .riwayat-filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (min-width: 1051px) and (max-width: 1279px) {
  .page-riwayat .riwayat-filter-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (max-width: 1050px) {
  .riwayat-sales-filter { grid-column:auto; }
  .edit-sale-layout { grid-template-columns:1fr; }
  .edit-sale-summary { position:static; }
}
@media (max-width: 700px) {
  .riwayat-filter-grid { grid-template-columns:1fr; }
  .riwayat-filter-head { align-items:center; }
  .riwayat-filter-hint { max-width:230px; }
  .riwayat-filter-actions { grid-template-columns:1fr 1fr; }
  .edit-sale-card,.edit-sale-summary { padding:var(--space-md); }
  .edit-sale-fields,.edit-payment-grid { grid-template-columns:1fr;gap:var(--space-sm); }
  .edit-item-row { grid-template-columns:minmax(0,1fr) 118px 34px;gap:8px; }
  .edit-item-total { grid-column:1 / 2;text-align:left; }
  .edit-item-remove { grid-column:3;grid-row:1; }
  .trx-item-wrap { align-items:center; }
  .trx-actions { flex:0 0 80px;flex-wrap:wrap;justify-content:flex-end;padding-right:8px;gap:4px; }
  .trx-action-btn { width:34px;height:34px; }
  .trx-detail-mobile { display:inline-flex; }
  .trx-readonly { display:none; }
  .trx-item-context { max-width:190px; }
  .trx-item-wrap.trx-highlighted::before { left:8px; }
  .riwayat-list-hint { margin-top:-3px;text-align:left;line-height:1.4; }
  .riwayat-hint-desktop { display:none; }
  .riwayat-hint-mobile { display:inline; }
  .riwayat-detail-overlay { place-items:end center;padding:0;background:rgba(3,7,18,.72); }
  .riwayat-detail-modal { width:100%;max-height:92dvh;border-width:1px 0 0;border-radius:20px 20px 0 0;animation:slideUp .25s ease; }
  .riwayat-detail-head { padding:16px 16px 13px; }
  .riwayat-detail-content { padding:14px 16px; }
  .riwayat-detail-info { grid-template-columns:1fr 1fr;gap:7px;margin-bottom:12px; }
  .riwayat-detail-info > div { padding:9px 10px; }
  .riwayat-detail-item { grid-template-columns:minmax(0,1fr) auto;padding:11px 10px; }
  .riwayat-detail-item-no { display:none; }
  .riwayat-detail-item-info strong { white-space:normal;line-height:1.35; }
  .riwayat-detail-item-total { align-self:start;padding-top:2px; }
  .riwayat-detail-totals { width:100%; }
  .riwayat-detail-actions { display:grid;grid-template-columns:1fr 1fr;padding:12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .riwayat-detail-actions #riwayatDetailDone { grid-column:1 / -1;margin:0;order:3; }
  .riwayat-detail-actions .btn { min-height:43px; }
}

.mobile-app-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: calc(var(--z-nav) + 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: max(8px, env(safe-area-inset-top)) var(--space-md) 8px;
  background: var(--bg-app);
  background: color-mix(in srgb, var(--bg-app) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.mobile-brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.mobile-brand-mark {
  display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px;
  border-radius: 10px; color: #fff; font-weight: 800; font-size: .88rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: var(--shadow-accent);
}
.mobile-brand strong, .mobile-brand small { display: block; line-height: 1.2; }
.mobile-brand strong { font-size: .86rem; letter-spacing: -.01em; }
.mobile-brand small { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: .68rem; margin-top: 2px; }
.mobile-menu-button, .mobile-header-action, .drawer-close {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-md);
  color: var(--text-primary); background: var(--bg-elevated); cursor: pointer;
}
.mobile-menu-button { gap: 4px; align-content: center; }
.mobile-menu-button span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.mobile-header-action svg, .drawer-close svg { width: 20px; height: 20px; }

.mobile-nav-scrim { position: fixed; inset: 0; z-index: 150; opacity: 0; background: rgba(3, 7, 18, .62); transition: opacity .18s ease; }
.mobile-nav-scrim.is-visible { opacity: 1; }
.mobile-nav-drawer {
  position: fixed; inset: 0 auto 0 0; z-index: 151; display: flex; flex-direction: column;
  width: min(86vw, 330px); padding: max(16px, env(safe-area-inset-top)) var(--space-md) max(16px, env(safe-area-inset-bottom));
  background: var(--bg-card); border-right: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateX(-105%); transition: transform .18s ease;
}
.mobile-nav-drawer.is-open { transform: translateX(0); }
.mobile-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding-bottom: var(--space-md); border-bottom: 1px solid var(--border); }
.mobile-drawer-head .user-badge { flex: 1; min-width: 0; }
.mobile-drawer-links { display: grid; gap: 4px; padding: var(--space-md) 0; }
.mobile-drawer-links .nav-item { margin: 0; }
.mobile-drawer-logout { margin-top: auto; }

.confirm-overlay {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: var(--space-md);
  background: rgba(3, 7, 18, .68); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.confirm-dialog {
  width: min(100%, 400px); padding: var(--space-lg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); background: var(--bg-elevated); box-shadow: var(--shadow-lg);
}
.confirm-dialog h2 { font-size: 1.05rem; line-height: 1.3; }
.confirm-dialog p { margin-top: 6px; color: var(--text-secondary); font-size: .88rem; }
.confirm-actions { display: flex; gap: var(--space-sm); justify-content: flex-end; margin-top: var(--space-lg); }
.confirm-primary { background: var(--danger); color: #fff; border-color: transparent; }

.main-content { width: 100%; padding-top: calc(60px + var(--space-md)); padding-bottom: calc(var(--nav-height-mobile) + max(var(--space-md), env(safe-area-inset-bottom)) + 10px); }
.topbar { margin-bottom: var(--space-lg); }
.topbar-title { font-size: 1.45rem; }
.topbar-sub { font-size: .78rem; }
.bottom-nav { height: calc(var(--nav-height-mobile) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav-item { min-width: 0; padding-inline: 6px; }
.bottom-nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62px; }
.card { border-radius: var(--radius-lg); }
.card-title { font-size: .72rem; }
.stat-card { min-height: 118px; }
.stat-value.lg { font-size: clamp(.92rem, 4vw, 1.15rem); }
.period-tabs { overflow-x: auto; scrollbar-width: none; }
.period-tab { min-width: 86px; min-height: 42px; }
.search-input { min-height: 46px; }
.customer-item { width: 100%; text-align: left; font: inherit; color: inherit; }
.customer-item:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); outline: 0; }
.pagination { flex-wrap: wrap; }
.modal { width: min(100% - 24px, 540px); }
.drawer { width: 100%; }

/* Tables and action lists remain legible below 576px. */
@media (max-width: 575px) {
  .pelanggan-toolbar { display: block; }
  .pelanggan-result-meta { margin-top: 8px; white-space: normal; }
  .pelanggan-grid .customer-item { gap: 10px; padding: 12px; }
  .pelanggan-grid .customer-avatar { height: 38px; width: 38px; }
  .customer-id { font-size: .62rem; padding: 3px 6px; }
  .customer-edit-icon { display: none; }
  .pelanggan-modal-sub { display: none; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 12px; }
  .stat-icon { margin-bottom: 6px; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .trx-item { padding: 12px 0; gap: 10px; }
  .trx-item-amount { font-size: .82rem; }
  .table-wrap { margin-inline: -4px; }
  .table th, .table td { padding: 10px 12px; }
  .drawer { border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: var(--space-md); max-height: 94dvh; }
  .modal:not(.drawer) { width: calc(100% - 24px); }
}

/* Tablet: still use the mobile navigation, with more breathing room. */
@media (min-width: 576px) and (max-width: 991px) {
  .main-content { padding-inline: clamp(24px, 6vw, 56px); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mobile-app-header { padding-inline: clamp(24px, 6vw, 56px); }
  .bottom-nav-item { max-width: 110px; }
}

/* The legacy stylesheet exposed the desktop sidebar at 768px; retain the
   mobile shell through tablet width as intended. */
@media (max-width: 991px) {
  .sidebar { display: none !important; }
  .bottom-nav { display: flex !important; }
  .mobile-app-header { display: flex; }
}

@media (min-width: 992px) {
  .mobile-app-header, .mobile-nav-drawer, .mobile-nav-scrim { display: none !important; }
  .sidebar { display: flex !important; }
  .bottom-nav { display: none !important; }
  .main-content {
    padding: clamp(24px, 3vw, 44px);
    padding-bottom: clamp(24px, 3vw, 44px);
    max-width: calc(100vw - var(--nav-width-desktop));
  }
  .topbar { margin-bottom: clamp(24px, 3vw, 36px); }
  .topbar-title { font-size: 1.65rem; }
  .card { padding: clamp(18px, 2vw, 28px); }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md); }
  .stat-card { min-height: 140px; }
  .quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .drawer { width: min(620px, calc(100vw - var(--nav-width-desktop) - 48px)); border-radius: var(--radius-xl); }
  .pelanggan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pelanggan-grid .customer-item { min-height: 92px; padding: 14px var(--space-md); }
  .pelanggan-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pelanggan-field-wide { grid-column: 1 / -1; }
  .page-pelanggan #pelangganModal {
    animation: fadeIn .18s ease forwards;
    bottom: auto;
    left: calc(var(--nav-width-desktop) + (100vw - var(--nav-width-desktop)) / 2);
    max-height: calc(100dvh - 64px);
    right: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(680px, calc(100vw - var(--nav-width-desktop) - 64px));
  }
}

/* Stop the old desktop-POS grid from altering dashboard, reports, and masters. */
@media (min-width: 1200px) {
  body:not(.page-kasir) { overflow: auto; }
  body:not(.page-kasir) .main-content { display: block !important; height: auto; min-height: 100vh; }
  body:not(.page-kasir) .topbar { display: flex !important; }
}

/* POS tablet/desktop sempit tetap memakai drawer. Aturan lama mulai 768px
   membuat cart dan drawer menjadi panel desktop sehingga saling bertumpuk. */
@media (min-width: 768px) and (max-width: 1199px) {
  .page-kasir .pos-desktop-layout {
    display: block;
    height: auto;
  }
  .page-kasir .pos-left {
    display: block;
    overflow: visible;
  }
  .page-kasir .pos-right,
  .page-kasir .cart-panel-desktop {
    display: none !important;
  }
  .page-kasir .drawer {
    position: fixed;
    z-index: var(--z-modal);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: var(--space-lg);
    max-height: 92dvh;
    overflow-y: auto;
    animation: slideUp .25s ease;
  }
  .page-kasir .drawer-handle { display: block; }
}

@media (min-width: 768px) and (max-width: 991px) {
  .page-kasir .drawer {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .page-kasir .drawer {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: min(620px, calc(100vw - var(--nav-width-desktop) - 48px));
    border-radius: var(--radius-xl);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}


/* Nota share A5 */
body.nota-share-open { overflow:hidden; }
.nota-share-overlay {
  position:fixed;inset:0;z-index:calc(var(--z-modal, 1000) + 30);display:grid;place-items:center;
  padding:20px;background:rgba(3,7,18,.78);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);
}
.nota-share-dialog {
  width:min(94vw,720px);max-height:92dvh;display:flex;flex-direction:column;overflow:hidden;
  border:1px solid var(--border);border-radius:18px;background:var(--bg-elevated);box-shadow:0 28px 80px rgba(0,0,0,.42);
}
.nota-share-head { display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:17px 20px 14px;border-bottom:1px solid var(--border); }
.nota-share-head h2 { margin:2px 0 0;font-size:1.05rem; }
.nota-share-eyebrow { color:var(--accent);font-size:.66rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em; }
.nota-share-close { width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:9px;background:transparent;color:var(--text-muted);font-size:1.7rem;cursor:pointer; }
.nota-share-close:hover { color:var(--text-primary);background:var(--bg-surface); }
.nota-share-body { min-height:0;overflow:auto;padding:16px 20px; }
.nota-share-info { margin-bottom:12px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--warning) 45%,transparent);border-radius:10px;background:var(--warning-light);color:var(--warning);font-size:.76rem;line-height:1.5; }
.nota-share-preview { display:grid;gap:14px;justify-items:center;padding:12px;border-radius:12px;background:#cbd5e1; }
.nota-share-preview img { display:block;width:min(100%,480px);height:auto;background:#fff;box-shadow:0 5px 20px rgba(15,23,42,.2); }
.nota-share-hint { margin:13px 0 0;color:var(--text-muted);font-size:.74rem;line-height:1.55; }
.nota-share-actions { display:flex;justify-content:flex-end;gap:8px;padding:13px 20px calc(13px + env(safe-area-inset-bottom));border-top:1px solid var(--border);background:var(--bg-elevated); }

@media (max-width:700px) {
  .trx-actions { flex-basis:112px; }
  .riwayat-detail-actions { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .nota-share-overlay { place-items:end center;padding:0; }
  .nota-share-dialog { width:100%;max-height:94dvh;border-width:1px 0 0;border-radius:20px 20px 0 0; }
  .nota-share-head { padding:15px 16px 12px; }
  .nota-share-body { padding:13px 16px; }
  .nota-share-actions { display:grid;grid-template-columns:1fr 1fr;padding:12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .nota-share-actions .btn-primary { grid-column:1 / -1;grid-row:1; }
}
