/* ==========================================================================
   GUDANGSMART — Design System & Global Stylesheet
   Mobile-First Responsive Warehouse Inventory with QR Scanner & Thermal Print
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS & CSS VARIABLES
   ========================================================================== */
:root {
  /* Colors — Background */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-hover: rgba(51, 65, 85, 0.9);

  /* Colors — Text */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Colors — Accent */
  --accent-indigo: #6366f1;
  --accent-indigo-hover: #4f46e5;
  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --accent-rose: #f43f5e;
  --accent-rose-hover: #e11d48;
  --accent-amber: #f59e0b;
  --accent-blue: #3b82f6;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  /* Typography & Layout */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-width: 260px;
  --header-height: 70px;
  --bottom-nav-height: 64px;
}


/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

a {
  color: var(--accent-indigo);
  text-decoration: none;
  transition: all 0.2s ease;
}


/* ==========================================================================
   3. UTILITY CLASSES
   ========================================================================== */
.text-success { color: var(--accent-emerald) !important; }
.text-danger  { color: var(--accent-rose) !important; }
.text-warning { color: var(--accent-amber) !important; }
.text-indigo  { color: var(--accent-indigo) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-xl      { font-size: 1.5rem; }
.text-right   { text-align: right; }
.font-mono    { font-family: monospace; }
.w-100        { width: 100% !important; }
.mt-2         { margin-top: 0.75rem !important; }
.hidden       { display: none !important; }

.bg-indigo  { background: linear-gradient(135deg, #6366f1, #4338ca); }
.bg-emerald { background: linear-gradient(135deg, #10b981, #047857); }
.bg-blue    { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.bg-amber   { background: linear-gradient(135deg, #f59e0b, #b45309); }
.bg-rose    { background: linear-gradient(135deg, #f43f5e, #be123c); }


/* ==========================================================================
   4. APP LAYOUT — Shell, Sidebar, Header, Content
   ========================================================================== */

/* --- App Container --- */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* --- Mobile Sidebar Backdrop --- */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1040;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* --- Sidebar (Desktop & Mobile Drawer) --- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1050;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-menu {
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

/* --- Logo --- */
.logo-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.logo-icon {
  width: 22px;
  height: 22px;
  color: #fff;
}

.logo-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

/* --- Navigation Items --- */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nav-item i {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05));
  color: var(--accent-indigo);
  border-left: 3px solid var(--accent-indigo);
}

/* --- Warehouse Badge (Sidebar Footer) --- */
.warehouse-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.warehouse-badge i {
  width: 24px;
  height: 24px;
  color: var(--accent-indigo);
}

.wh-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.wh-status {
  font-size: 0.75rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
}

/* --- Main Content Area --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-height) + 1rem);
}

@media (min-width: 768px) {
  .main-content {
    padding-bottom: 2rem;
  }
}

/* --- Top Header Bar --- */
.top-header {
  height: var(--header-height);
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#page-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- User Profile Badge (Header) --- */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
}

.user-profile-badge i {
  width: 16px;
  height: 16px;
  color: var(--accent-emerald);
}

/* --- Content Body --- */
.content-body {
  padding: 1.5rem;
  flex: 1;
}


/* ==========================================================================
   5. VIEW PAGES & ANIMATIONS
   ========================================================================== */
.view-page {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-page.active {
  display: block;
}

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

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes scanLine {
  0%   { top: 10px; opacity: 0.8; }
  50%  { top: 200px; opacity: 1; }
  100% { top: 10px; opacity: 0.8; }
}


/* ==========================================================================
   6. DASHBOARD — KPI Cards, Banner, Two-Column Layout
   ========================================================================== */

/* --- KPI Summary Cards --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background-color: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon i {
  width: 26px;
  height: 26px;
  color: #fff;
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 0.2rem 0;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* --- Dashboard Banner --- */
.dashboard-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.banner-content h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.banner-content p {
  max-width: 600px;
  margin-bottom: 1.25rem;
}

.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --- Two-Column Layout --- */
.dashboard-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .dashboard-two-col {
    grid-template-columns: 1fr 1fr;
  }
}


/* ==========================================================================
   7. CARDS & WIDGETS
   ========================================================================== */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-body {
  padding: 1.25rem;
}

.card-body.p-0 {
  padding: 0;
}

/* --- Item List Widget --- */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
}

.item-row:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.item-detail {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.item-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-indigo);
  overflow: hidden;
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.item-sku {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.item-meta {
  text-align: right;
}

/* --- Badges --- */
.item-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-success { background-color: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.badge-warning { background-color: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.badge-danger  { background-color: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.badge-info    { background-color: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }

/* --- Transaction Timeline --- */
.transaction-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tx-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.tx-timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tx-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tx-icon-badge.inbound {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
}

.tx-icon-badge.outbound {
  background-color: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
}

.tx-info {
  flex: 1;
}

.tx-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.tx-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tx-qty {
  font-weight: 700;
  font-size: 0.95rem;
}


/* ==========================================================================
   8. QR CAMERA SCANNER
   ========================================================================== */
.scanner-page-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 850px) {
  .scanner-page-container {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.scanner-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.scanner-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.bg-success-light { background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05)); }
.bg-danger-light  { background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(244, 63, 94, 0.05)); }

.scanner-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.scanner-header-info h2 {
  font-size: 1.15rem;
}

.scanner-header-info p {
  font-size: 0.82rem;
}

/* --- Scanner Viewport --- */
.scanner-viewport-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-reader-element {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.qr-reader-element video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* --- Scanner Overlay & Scan Line --- */
.scanner-overlay-box {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.35);
}

.scan-frame {
  width: 220px;
  height: 220px;
  position: relative;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
}

.corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--accent-emerald);
  border-style: solid;
  border-width: 0;
}

.danger-mode .corner {
  border-color: var(--accent-rose);
}

.corner.tl { top: -2px; left: -2px; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 12px; }
.corner.tr { top: -2px; right: -2px; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 12px; }
.corner.bl { bottom: -2px; left: -2px; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 12px; }
.corner.br { bottom: -2px; right: -2px; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 12px; }

.scan-line {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-emerald), transparent);
  box-shadow: 0 0 12px var(--accent-emerald);
  border-radius: 50%;
  animation: scanLine 2s infinite ease-in-out;
}

.scan-line.red {
  background: linear-gradient(90deg, transparent, var(--accent-rose), transparent);
  box-shadow: 0 0 12px var(--accent-rose);
}

.scan-tip {
  margin-top: 1.5rem;
  color: #fff;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Scanner Controls --- */
.scanner-controls {
  padding: 1.25rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  background-color: var(--bg-card);
}

.manual-input-box {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.2);
}

.manual-input-box span {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

.input-group input {
  flex: 1;
}

/* --- Scan Result Card --- */
.scan-result-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 250px;
}

.result-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.result-placeholder i {
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.result-success-box {
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scan-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.result-prod-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.result-prod-sku {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.stock-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-box {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-box-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-box-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}


/* ==========================================================================
   9. PRODUCTS GRID & PRODUCT CARDS
   ========================================================================== */
.table-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding-left: 2.75rem;
}

.filter-group {
  display: flex;
  gap: 0.75rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
}

.prod-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.prod-cat-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.prod-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.prod-sku-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: monospace;
}

.prod-koli-specs {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  margin: 0.85rem 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.prod-stock-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stock-num {
  font-size: 1.5rem;
  font-weight: 700;
}

.prod-actions {
  display: flex;
  gap: 0.5rem;
}

.prod-actions .btn {
  flex: 1;
}


/* ==========================================================================
   10. DATA TABLE (Transactions)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.data-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}


/* ==========================================================================
   11. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; border-radius: var(--radius-lg); }

.btn-primary       { background-color: var(--accent-indigo); color: #fff; }
.btn-primary:hover  { background-color: var(--accent-indigo-hover); }

.btn-emerald       { background-color: var(--accent-emerald); color: #fff; }
.btn-emerald:hover  { background-color: var(--accent-emerald-hover); }

.btn-rose          { background-color: var(--accent-rose); color: #fff; }
.btn-rose:hover     { background-color: var(--accent-rose-hover); }

.btn-success       { background-color: var(--accent-emerald); color: #fff; }
.btn-danger        { background-color: var(--accent-rose); color: #fff; }

.btn-secondary       { background-color: var(--bg-tertiary); color: var(--text-primary); }
.btn-secondary:hover  { background-color: #475569; }

.btn-outline       { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-outline:hover  { background-color: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.2); }

.btn-icon    { padding: 0.6rem; border-radius: var(--radius-md); background: transparent; border: none; color: var(--text-primary); cursor: pointer; }
.btn-icon-lg { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }


/* ==========================================================================
   12. FORM INPUTS & CONTROLS
   ========================================================================== */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.form-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: block;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.col-4 { flex: 1; }
.col-6 { flex: 1; }


/* ==========================================================================
   13. MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(15px);
  transition: transform 0.25s ease;
}

.modal-card.modal-lg {
  max-width: 800px;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-close:hover {
  color: var(--text-primary);
}

.modal-card form,
.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: rgba(0, 0, 0, 0.15);
}


/* ==========================================================================
   14. PRINT STICKER MODAL & PREVIEW
   ========================================================================== */
.print-settings-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .print-settings-body {
    grid-template-columns: 300px 1fr;
  }
}

.print-preview-container {
  background-color: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 1rem;
  color: #0f172a;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.preview-label-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.print-preview-area {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  overflow-y: auto;
  max-height: 380px;
  padding: 0.5rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1rem 0;
}

/* --- Printable Sticker Label (RMedia Thermal 100×150mm Template) --- */
.sticker-label-box {
  width: 260px;
  background: #fff;
  border: 2.5px solid #1a1a1a;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  color: #000;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Sticker Header: Logo + Subtitle */
.sticker-header {
  width: 100%;
  margin-bottom: 8px;
}

.sticker-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sticker-logo svg {
  color: #000;
  flex-shrink: 0;
}

.sticker-logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #000;
}

.sticker-divider {
  width: 100%;
  height: 2px;
  background: #000;
  margin: 4px 0;
}

.sticker-subtitle {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #333;
  margin: 6px 0 2px;
}

/* QR Code Area */
.sticker-qr-area {
  width: 90%;
  border: 2.5px solid #1a1a1a;
  border-radius: 10px;
  padding: 12px;
  margin: 6px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.sticker-qr-canvas {
  width: 150px;
  height: 150px;
}

.sticker-qr-canvas canvas,
.sticker-qr-canvas img {
  width: 100% !important;
  height: 100% !important;
}

/* Product Info */
.sticker-product-info {
  width: 100%;
  margin-bottom: 8px;
}

.sticker-prod-name {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  color: #000;
  margin-bottom: 3px;
}

.sticker-sku {
  font-size: 0.78rem;
  font-family: monospace;
  font-weight: 700;
  background: #f1f5f9;
  color: #000;
  padding: 3px 10px;
  border-radius: 4px;
  display: inline-block;
}

/* Detail Rows (ISI KOLI / RAK / BIN) */
.sticker-details {
  width: 100%;
  text-align: left;
  margin: 6px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sticker-detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1a1a1a;
}

.sticker-detail-row svg {
  flex-shrink: 0;
  color: #333;
}

.detail-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 60px;
}

.detail-sep {
  font-weight: 700;
}

.detail-value {
  font-weight: 600;
}

.detail-blank {
  color: #999;
  letter-spacing: 1px;
}

/* Sticker Footer */
.sticker-footer {
  width: 100%;
  margin-top: 4px;
}

.sticker-footer-dots {
  width: 100%;
  height: 1px;
  border-top: 2px dotted #999;
  margin-bottom: 6px;
}

.sticker-footer-text {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
}


/* ==========================================================================
   15. LOGIN SCREEN
   ========================================================================== */
.login-overlay-full {
  display: none;
  z-index: 9999;
}

.login-overlay-full.active {
  display: flex !important;
  background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
              radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.login-card {
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(16px);
  animation: modalPopIn 0.4s ease-out;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.login-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.logo-box.lg {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem auto;
  border-radius: var(--radius-lg);
}

.logo-box.lg i {
  width: 32px;
  height: 32px;
}

/* --- Login Form Input with Icons --- */
.input-icon-wrapper {
  position: relative;
  width: 100%;
}

.input-icon-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon-wrapper input {
  padding-left: 2.75rem;
}


/* ==========================================================================
   16. MOBILE BOTTOM NAVIGATION
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background-color: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 99;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.bottom-nav-item i {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active {
  color: var(--accent-indigo);
}


/* ==========================================================================
   17. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .toast-container {
    bottom: 25px;
  }
}

.toast {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 280px;
}

.border-success { border-left: 3px solid var(--accent-emerald); }
.border-danger  { border-left: 3px solid var(--accent-rose); }
.border-info    { border-left: 3px solid var(--accent-indigo); }


/* ==========================================================================
   18. RESPONSIVE BREAKPOINTS (Mobile-First Polish)
   ========================================================================== */

/* --- Visibility Helpers --- */
.mobile-only  { display: none !important; }
.desktop-only { display: inline-flex !important; }

@media (max-width: 767px) {
  .mobile-only  { display: flex !important; }
  .desktop-only { display: none !important; }

  /* --- Sidebar Mobile Drawer --- */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding-bottom: 75px;
  }

  /* --- Header Bar --- */
  .top-header {
    height: 58px;
    padding: 0 0.85rem;
    gap: 0.5rem;
  }

  .header-left {
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
  }

  #page-title {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
  }

  .header-right {
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .user-profile-badge {
    padding: 0.4rem;
    border-radius: 50%;
  }

  .user-profile-badge i {
    width: 18px;
    height: 18px;
  }

  .btn-icon-mobile {
    padding: 0.45rem;
    border-radius: var(--radius-md);
  }

  .content-body {
    padding: 0.85rem;
  }

  /* --- KPI Summary Grid (Strict 2-Column on Mobile) --- */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
    margin-bottom: 1rem;
  }

  .kpi-card {
    padding: 0.75rem 0.65rem;
    gap: 0.6rem;
    border-radius: var(--radius-md);
  }

  .kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .kpi-icon i {
    width: 18px;
    height: 18px;
  }

  .kpi-label {
    font-size: 0.65rem;
    letter-spacing: 0.02em;
  }

  .kpi-value {
    font-size: 1.25rem;
    margin: 0.05rem 0;
  }

  .kpi-sub {
    display: none !important;
  }

  /* --- Dashboard Banner --- */
  .dashboard-banner {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
  }

  .banner-content h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }

  .banner-content p {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .banner-actions {
    display: flex;
    gap: 0.5rem;
  }

  .banner-actions .btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }

  /* --- Product Grid --- */
  .products-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .product-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .table-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .search-box {
    min-width: 100%;
  }

  .filter-group {
    justify-content: stretch;
  }

  .filter-group .btn,
  .filter-group select {
    flex: 1;
  }

  /* --- Scanner Viewport --- */
  .scanner-page-container {
    gap: 1rem;
  }

  .scanner-controls {
    padding: 0.85rem;
  }

  .scanner-controls .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* --- Modal Sheet --- */
  .login-card {
    padding: 1.75rem 1.25rem;
    margin: 0.75rem;
    border-radius: var(--radius-md);
  }

  .modal-card {
    max-height: 85vh;
    border-radius: var(--radius-md);
  }
}


/* ==========================================================================
   19. PRINT MEDIA
   ========================================================================== */

/* Remove browser headers/footers, set page to thermal sticker size */
@page {
  size: 100mm 150mm;
  margin: 5mm;
}

@media print {
  /* Hide everything by default */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  body * {
    visibility: hidden !important;
  }

  /* Show only the printable sticker area */
  #printable-area,
  #printable-area * {
    visibility: visible !important;
  }

  #printable-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 5mm !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Clean sticker for 100×150mm thermal print */
  .sticker-label-box {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 2px solid #000 !important;
    border-radius: 3mm !important;
    width: 88mm !important;
    padding: 4mm !important;
    background: #fff !important;
  }

  .sticker-header { margin-bottom: 2mm !important; }

  .sticker-logo-text {
    font-size: 18pt !important;
    font-weight: 900 !important;
    color: #000 !important;
  }

  .sticker-logo svg {
    width: 8mm !important;
    height: 8mm !important;
  }

  .sticker-divider {
    height: 0.6mm !important;
    background: #000 !important;
  }

  .sticker-subtitle {
    font-size: 8pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    margin: 2mm 0 1mm !important;
  }

  .sticker-qr-area {
    width: 92% !important;
    border: 2px solid #000 !important;
    border-radius: 2.5mm !important;
    padding: 3mm !important;
    margin: 2mm 0 3mm !important;
  }

  .sticker-qr-canvas {
    width: 50mm !important;
    height: 50mm !important;
  }

  .sticker-qr-canvas canvas,
  .sticker-qr-canvas img {
    width: 100% !important;
    height: 100% !important;
  }

  .sticker-prod-name {
    font-size: 12pt !important;
    font-weight: 800 !important;
    color: #000 !important;
    margin-bottom: 1mm !important;
  }

  .sticker-sku {
    font-size: 10pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    background: #eee !important;
    padding: 1mm 3mm !important;
    border-radius: 1mm !important;
  }

  .sticker-details {
    margin: 2mm 0 3mm !important;
    gap: 1.5mm !important;
  }

  .sticker-detail-row {
    font-size: 9pt !important;
    font-weight: 600 !important;
    color: #000 !important;
  }

  .sticker-detail-row svg {
    width: 4mm !important;
    height: 4mm !important;
  }

  .sticker-footer-dots {
    border-top: 1.5px dotted #666 !important;
    margin-bottom: 2mm !important;
  }

  .sticker-footer-text {
    font-size: 7pt !important;
    font-weight: 700 !important;
    color: #333 !important;
  }

  /* Hide all non-printable UI elements */
  .app-container,
  .sidebar,
  .top-header,
  .bottom-nav,
  .modal-overlay,
  .toast-container,
  #login-overlay,
  #print-preview-area {
    display: none !important;
    visibility: hidden !important;
  }
}
