/* ============================================================
   SLIPER — Design System v2.0 (SMGKKK-Style Mobile PWA)
   Mobile-first, dark mode default, max-width 500px container
   Fonts: Outfit (title) + Inter (body) via Google Fonts
   ============================================================ */

/* ─── CSS Variables — Light Mode Default ─────────────────── */
:root {
  /* Font */
  --font-title: 'Outfit', 'Inter', sans-serif;
  --font-body:  'Inter', sans-serif;

  /* Background */
  --bg-primary:    #f8fafc;
  --bg-secondary:  #f1f5f9;
  --bg-card:       #ffffff;
  --bg-card-hover: #fafafa;
  --border-color:  #e2e8f0;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  /* Brand Colors */
  --primary:         #4f46e5;
  --primary-hover:   #4338ca;
  --primary-light:   #e0e7ff;
  --secondary:       #8b5cf6;
  --secondary-light: #f5f3ff;

  /* Status Colors */
  --color-pending:  #f59e0b;
  --color-printed:  #10b981;
  --color-locked:   #94a3b8;
  --color-info:     #3b82f6;
  --color-danger:   #f43f5e;
  --color-cyan:     #06b6d4;

  /* Shadows */
  --shadow-sm:      0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-premium: 0 20px 25px -5px rgba(79, 70, 229, 0.12), 0 10px 10px -5px rgba(79, 70, 229, 0.05);

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Dark Mode Overrides ─────────────────────────────────── */
[data-theme='dark'] {
  --bg-primary:    #0f172a;
  --bg-secondary:  #1e293b;
  --bg-card:       #1e293b;
  --bg-card-hover: #334155;
  --border-color:  #334155;

  --text-primary:   #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted:     #64748b;

  --primary:         #6366f1;
  --primary-hover:   #4f46e5;
  --primary-light:   #312e81;
  --secondary:       #a78bfa;
  --secondary-light: #2e1065;

  --shadow-sm:      0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-premium: 0 20px 25px -5px rgba(99, 102, 241, 0.15), 0 10px 10px -5px rgba(99, 102, 241, 0.05);
}

/* ─── CSS Reset & Base ────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition-fast);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── App Container ───────────────────────────────────────── */
#app, .container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.12);
  padding-bottom: 74px; /* clearance for bottom-nav */
}

/* ─── Glassmorphism Utility ───────────────────────────────── */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
[data-theme='dark'] .glass {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ────────────────────────────────────────────────────────────
   SPLASH SCREEN
   ──────────────────────────────────────────────────────────── */
.splash-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: #ffffff;
  transition: opacity var(--transition-slow) ease, visibility var(--transition-slow);
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-logo {
  font-family: var(--font-title);
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(to right, #ffffff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: splashScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  margin-bottom: 6px;
}

.splash-subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 2.8rem;
  animation: splashFadeIn 1s ease 0.3s forwards;
  color: rgba(255,255,255,0.75);
}

.splash-loader {
  width: 36px; height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.9s ease-in-out infinite;
}

/* ────────────────────────────────────────────────────────────
   APP HEADER (Sticky, Glassmorphism)
   ──────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background-color: rgba(248, 250, 252, 0.88);
  transition: background-color var(--transition-normal);
  flex-shrink: 0;
}

[data-theme='dark'] .app-header {
  background-color: rgba(15, 23, 42, 0.9);
}

.app-title-group h1 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-title-group p {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px; height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

.icon-btn:active {
  transform: scale(0.93);
}

/* User Avatar button */
.user-btn {
  width: 36px; height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: var(--shadow-sm);
}

/* ────────────────────────────────────────────────────────────
   BOTTOM NAVIGATION
   ──────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: 68px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--border-color);
  z-index: 900;
  background-color: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-bottom: env(safe-area-inset-bottom);
}

[data-theme='dark'] .bottom-nav {
  background-color: rgba(15, 23, 42, 0.92);
}

.nav-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  width: 64px;
  height: 52px;
  border-radius: var(--radius-md);
  position: relative;
  cursor: pointer;
  transition: color var(--transition-fast);
  text-decoration: none;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 28px;
  position: relative;
  transition: transform var(--transition-fast);
}

.nav-item.active .nav-icon-container {
  transform: translateY(-2px);
}

.nav-icon-container svg {
  width: 22px; height: 22px;
}

.nav-label {
  font-size: 0.63rem;
  font-weight: 600;
  margin-top: 2px;
}

.nav-dot {
  position: absolute;
  bottom: 2px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background-color: var(--primary);
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-fast);
}

.nav-item.active .nav-dot {
  opacity: 1;
  transform: scale(1);
}

/* ─── App Content Area ────────────────────────────────────── */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

/* ────────────────────────────────────────────────────────────
   FLOATING ACTION BUTTON (FAB)
   ──────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 84px;
  right: calc(50% - 232px);
  z-index: 850;
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-premium);
  animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
  border: none;
}

@media (max-width: 500px) {
  .fab { right: 18px; }
}

.fab:active {
  transform: scale(0.9);
  filter: brightness(1.1);
}

/* ────────────────────────────────────────────────────────────
   BOTTOM SHEET / MODAL PANEL
   ──────────────────────────────────────────────────────────── */
.bottom-sheet-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal);
}

.bottom-sheet-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  width: 100%;
  max-width: 500px;
  background-color: var(--bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 8px 22px 28px;
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-sheet-backdrop.open .bottom-sheet {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 40px; height: 4px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  margin: 0 auto 18px;
}

.bottom-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.bottom-sheet-header h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ────────────────────────────────────────────────────────────
   CENTER MODAL (for dialogs)
   ──────────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s ease;
  overflow: hidden;
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 15px; font-weight: 700; }

.modal-close {
  background: none; border: none;
  color: var(--text-muted);
  padding: 5px; border-radius: 8px;
  line-height: 0;
  transition: all var(--transition-fast);
}

.modal-close:hover { color: var(--text-primary); background: var(--bg-secondary); }

.modal-body { padding: 20px; }

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ────────────────────────────────────────────────────────────
   CARDS
   ──────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: box-shadow var(--transition-fast);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.card-title { font-size: 14px; font-weight: 700; }

/* ─── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--primary));
}

.stat-card:active { transform: scale(0.98); }

/* 2-card variant for dashboard (full width each) */
.stats-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.stats-grid-2 .stat-card {
  cursor: pointer;
}

.stats-grid-2 .stat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card.c1 { --accent: var(--color-pending); }
.stat-card.c2 { --accent: var(--color-printed); }
.stat-card.c3 { --accent: var(--primary); }
.stat-card.c4 { --accent: var(--color-info); }

.stat-ico { font-size: 22px; margin-bottom: 8px; }
.stat-num {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ────────────────────────────────────────────────────────────
   TABLE
   ──────────────────────────────────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl thead tr { background: var(--bg-secondary); }

.tbl thead th {
  padding: 10px 13px;
  text-align: left;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border-color);
}

.tbl tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.tbl tbody tr:last-child { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg-card-hover); }
.tbl td { padding: 10px 13px; vertical-align: middle; }

/* ────────────────────────────────────────────────────────────
   BADGES
   ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
}

.badge-pending   { background: rgba(245,158,11,.12);  color: #f59e0b; border-color: rgba(245,158,11,.3); }
.badge-printed   { background: rgba(16,185,129,.12);  color: #10b981; border-color: rgba(16,185,129,.3); }
.badge-cancelled { background: rgba(244,63,94,.12);   color: #f43f5e; border-color: rgba(244,63,94,.3); }
.badge-open      { background: rgba(16,185,129,.12);  color: #10b981; border-color: rgba(16,185,129,.3); }
.badge-locked    { background: rgba(148,163,184,.12); color: var(--text-muted); border-color: rgba(148,163,184,.25); }
.badge-toko      { background: rgba(6,182,212,.1);    color: #06b6d4; border-color: rgba(6,182,212,.25); }
.badge-gudang    { background: rgba(99,102,241,.1);   color: var(--primary); border-color: rgba(99,102,241,.25); }

/* ────────────────────────────────────────────────────────────
   BUTTONS
   ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active:not(:disabled) { filter: brightness(0.92); transform: translateY(0); }

.btn-secondary {
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-secondary); border-color: var(--primary); }
.btn-secondary:active:not(:disabled) { background: var(--bg-secondary); }

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #dc2626);
  color: #ffffff;
}
.btn-danger:active:not(:disabled) { filter: brightness(0.9); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-print {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
  font-size: 0.9rem;
  padding: 11px 24px;
}
.btn-print:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(8, 145, 178, 0.5);
}

.btn-locked {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: not-allowed;
  font-size: 0.9rem;
  padding: 11px 24px;
}

.btn-sm  { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius-md); }

.btn-group {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-top: 20px;
}

/* ────────────────────────────────────────────────────────────
   FORMS
   ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control, .form-ctrl {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-ctrl:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

.form-control::placeholder, .form-ctrl::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap .form-ctrl { padding-left: 32px; }

/* ────────────────────────────────────────────────────────────
   PAGINATION
   ──────────────────────────────────────────────────────────── */
.pager {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding-top: 14px;
  flex-wrap: wrap;
}

.pager-btn {
  min-width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pager-btn:hover { border-color: var(--primary); color: var(--primary); }
.pager-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
}
.pager-btn.disabled { opacity: 0.35; pointer-events: none; }

/* ────────────────────────────────────────────────────────────
   INFO GRID
   ──────────────────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 20px;
}

.info-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.info-val {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ────────────────────────────────────────────────────────────
   PRINT AREA
   ──────────────────────────────────────────────────────────── */
.print-area {
  background: linear-gradient(135deg, rgba(8,145,178,0.06), rgba(99,102,241,0.04));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.print-info h4 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.print-info p  { font-size: 12px; color: var(--text-muted); }

/* ────────────────────────────────────────────────────────────
   PRINTER OPTIONS (in modal)
   ──────────────────────────────────────────────────────────── */
.printer-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.printer-opt:hover { border-color: var(--primary); background: var(--primary-light); }
.printer-opt.sel   { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

.printer-opt-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.printer-opt h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.printer-opt p  { font-size: 11px; color: var(--text-muted); }

/* ────────────────────────────────────────────────────────────
   RECEIPT PREVIEW
   ──────────────────────────────────────────────────────────── */
.receipt-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre;
  overflow-x: auto;
  max-height: 180px;
  overflow-y: auto;
}

/* ────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ──────────────────────────────────────────────────────────── */
#toasts {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 320px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  animation: slideInRight 0.25s ease;
  position: relative;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--toast-color, var(--color-info));
}

.toast.t-success { --toast-color: var(--color-printed); }
.toast.t-error   { --toast-color: var(--color-danger); }
.toast.t-warning { --toast-color: var(--color-pending); }

/* ────────────────────────────────────────────────────────────
   STOK / LOKASI TABS
   ──────────────────────────────────────────────────────────── */
.lokasi-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.lokasi-tab {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  white-space: nowrap;
}

.lokasi-tab:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.lokasi-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

/* ────────────────────────────────────────────────────────────
   LOGIN PAGE
   ──────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -120px;
  right: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.35s ease;
  position: relative;
  z-index: 1;
}

.login-logo { text-align: center; margin-bottom: 28px; }

.login-logo-icon {
  width: 58px; height: 58px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-md);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-premium);
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-logo p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.login-err {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #f43f5e;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 14px;
}

/* ────────────────────────────────────────────────────────────
   DETAIL HEADER
   ──────────────────────────────────────────────────────────── */
.detail-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.detail-hd h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 3px; }
.detail-hd .sub { font-size: 12px; color: var(--text-muted); }
.detail-hd .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ────────────────────────────────────────────────────────────
   SPINNER & LOADING
   ──────────────────────────────────────────────────────────── */
.spin {
  width: 30px; height: 30px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.center-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 55vh;
}

/* ────────────────────────────────────────────────────────────
   EMPTY STATE
   ──────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.45; }
.empty h3   { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty p    { font-size: 13px; color: var(--text-muted); }

/* ────────────────────────────────────────────────────────────
   USER DROPDOWN / POPOVER
   ──────────────────────────────────────────────────────────── */
.user-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 8px;
  z-index: 200;
  animation: slideDown 0.18s ease;
}

.popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.popover-item:hover { background: var(--bg-secondary); }
.popover-item.danger { color: var(--color-danger); }
.popover-item.danger:hover { background: rgba(244, 63, 94, 0.08); }

.popover-divider { height: 1px; background: var(--border-color); margin: 6px 0; }

/* ────────────────────────────────────────────────────────────
   UTILITY CLASSES
   ──────────────────────────────────────────────────────────── */
.nowrap  { white-space: nowrap; }
.bold    { font-weight: 700; }
.muted   { color: var(--text-muted); }
.sm      { font-size: 12px; }
.pri-clr { color: var(--primary); }
.ok-clr  { color: var(--color-printed); }
.err-clr { color: var(--color-danger); }
.num     { font-variant-numeric: tabular-nums; font-weight: 600; }
.mb-4    { margin-bottom: 16px; }
.mt-4    { margin-top: 16px; }
.gap-2   { gap: 8px; }
.flex    { display: flex; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full  { width: 100%; }

/* ────────────────────────────────────────────────────────────
   ANIMATIONS
   ──────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes splashFadeIn {
  to { opacity: 1; }
}

@keyframes splashScale {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes bounceIn {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

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

/* ────────────────────────────────────────────────────────────
   ITEM ROW (Detail Barang dalam Nota & Surat Jalan)
   No table, no horizontal scroll
   ──────────────────────────────────────────────────────────── */

.item-list {
  display: flex;
  flex-direction: column;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.item-row:last-of-type {
  border-bottom: none;
}

.item-row-no {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.item-row-body {
  flex: 1;
  min-width: 0;
}

.item-row-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-row-code {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.item-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 2px;
}

.item-row-sub {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.item-row-price {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Total row at bottom of item list */
.item-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 4px;
  border-top: 2px solid var(--border-color);
  margin-top: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.item-total-amt {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* ────────────────────────────────────────────────────────────
   STOK CARD (Laporan Stok per item)
   ──────────────────────────────────────────────────────────── */

.stok-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 7px;
  transition: border-color var(--transition-fast);
}

.stok-card:hover {
  border-color: var(--primary);
}

.stok-card-left {
  flex: 1;
  min-width: 0;
}

.stok-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.stok-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.stok-card-kode {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  font-family: monospace;
}

.stok-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.stok-card-saldo {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stok-card-sat {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ────────────────────────────────────────────────────────────
   DOC CARD LIST (Antrian Cetak & Riwayat Cetak)
   Compact card layout — no horizontal scroll
   ──────────────────────────────────────────────────────────── */

/* Search bar compact */
.doc-search-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

/* List section header */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 10px;
}

.list-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.list-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

/* Doc card — single row clickable item */
.doc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.doc-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.doc-card:hover::before,
.doc-card:active::before {
  opacity: 1;
}

.doc-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.doc-card:active {
  transform: scale(0.98);
  opacity: 0.85;
}

/* Printed variant — subtle green accent */
.doc-card-printed::before {
  background: var(--color-printed);
}

.doc-card-printed:hover {
  border-color: var(--color-printed);
}

/* Left section */
.doc-card-left {
  flex: 1;
  min-width: 0;
}

.doc-card-num {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.doc-card-cust {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.doc-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Right section */
.doc-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.doc-card-amount {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.doc-card-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1;
  margin-top: 2px;
}

/* ────────────────────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card { padding: 26px 18px; }
  .stats-grid { gap: 10px; }
  .stat-num   { font-size: 1.75rem; }
  .app-content { padding: 14px; }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-ctrl { width: 100% !important; }
  .search-wrap { min-width: 100% !important; }
  .print-area { flex-direction: column; align-items: flex-start; }
  .info-grid  { grid-template-columns: 1fr 1fr; }
}

/* Segmented Control / Page Sub Tabs */
.segmented-control {
  display: flex;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  gap: 4px;
}

.segmented-item {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: calc(var(--radius-md) - 2px);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.segmented-item:hover {
  color: var(--text-primary);
}

.segmented-item.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

[data-theme='dark'] .segmented-item.active {
  background-color: #334155;
}

/* ─── STOK GUDANG v2 ─────────────────────────────────────── */

/* Summary strip */
.stok-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  margin-bottom: 12px;
  gap: 8px;
}
.stok-sum-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.stok-sum-num {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-title);
  line-height: 1;
  color: var(--text-primary);
}
.stok-sum-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.stok-sum-divider {
  width: 1px;
  height: 36px;
  background: var(--border-color);
  flex-shrink: 0;
}
.ok-clr  { color: #10b981 !important; }
.err-clr { color: #f43f5e !important; }

/* Grid layout */
.stok-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 24px;
}
@media (max-width: 360px) {
  .stok-grid { grid-template-columns: 1fr; }
}

/* Card v2 */
.stok-card-v2 {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.stok-card-v2:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.stok-card-v2-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stok-card-v2-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}
.stok-loc-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  padding: 2px 7px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.stok-card-v2-right {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.stok-card-v2-saldo {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-title);
  line-height: 1;
  flex: 1;
}
.stok-card-v2-sat {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 3px;
}

/* Status dot (top-right corner indicator) */
.stok-status-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Status color classes */
.stok-aman   { color: #10b981; }
.stok-rendah { color: #f59e0b; }
.stok-habis  { color: #f43f5e; }

.stok-status-dot.stok-aman   { background: #10b981; }
.stok-status-dot.stok-rendah { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.stok-status-dot.stok-habis  { background: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,0.2); }

/* Dark mode overrides */
[data-theme='dark'] .stok-card-v2 { background: #1e293b; border-color: #334155; }
[data-theme='dark'] .stok-summary-strip { background: #1e293b; border-color: #334155; }
[data-theme='dark'] .stok-loc-badge { background: #0f172a; color: #64748b; }
