/* ==========================================================================
   SISTEM KASIR & MANAJEMEN TRANSAKSI CLOUD - FOTOCOPY DANIEL.COM
   Palet Warna Modern Sapphire Blue & Google Cloud Palette
   ========================================================================== */

:root {
  /* Color Palette - Clean Crisp Light System */
  --bg-main: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-alt: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.9);
  
  --border-subtle: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #2563eb;
  --border-glass: rgba(226, 232, 240, 0.8);

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Primary Accent - Modern Sapphire Blue (Fotocopy & Digital Print Theme) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-subtle: #dbeafe;

  --success: #059669;
  --success-hover: #047857;
  --success-light: #ecfdf5;
  --success-subtle: #d1fae5;

  --warning: #d97706;
  --warning-hover: #b45309;
  --warning-light: #fffbeb;
  --warning-subtle: #fef3c7;

  --danger: #e11d48;
  --danger-hover: #be123c;
  --danger-light: #fff1f2;
  --danger-subtle: #ffe4e6;

  --info: #0284c7;
  --info-hover: #0369a1;
  --info-light: #f0f9ff;
  --info-subtle: #e0f2fe;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.2);

  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Layout App Container */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 45%),
              radial-gradient(circle at bottom left, rgba(5, 150, 105, 0.03), transparent 45%),
              var(--bg-main);
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.75rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.nav-logo-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.nav-brand-logo-img {
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-subtle);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.nav-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* SSE Status Pill */
.sse-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  transition: all 0.3s ease;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.sse-connected {
  color: var(--success);
  border-color: #a7f3d0;
  background: var(--success-light);
}
.sse-connected .pulse-dot {
  background: var(--success);
}
.sse-connected .pulse-dot::after {
  border: 2px solid var(--success);
}

.sse-connecting {
  color: var(--warning);
  border-color: #fde68a;
  background: var(--warning-light);
}
.sse-connecting .pulse-dot {
  background: var(--warning);
}
.sse-connecting .pulse-dot::after {
  border: 2px solid var(--warning);
}

.sse-disconnected {
  color: var(--danger);
  border-color: #fecdd3;
  background: var(--danger-light);
}
.sse-disconnected .pulse-dot {
  background: var(--danger);
}
.sse-disconnected .pulse-dot::after {
  border: 2px solid var(--danger);
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* User Profile Badge */
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.role-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
}

.btn-icon {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--danger-light);
  border-color: #fca5a5;
  color: var(--danger);
}

/* Main Container */
.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tab-pane.active {
  display: block;
}

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

/* ==========================================================================
   MODUL 1: POINT OF SALE (POS) LAYOUT
   ========================================================================== */
.pos-container {
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 1.5rem;
  height: calc(100vh - 120px);
}

/* Left: Catalog Side */
.pos-catalog-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  overflow: hidden;
}

.pos-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.pos-search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.pos-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
}
.pos-search-input::placeholder {
  color: var(--text-dim);
}

.category-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.chip-btn {
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: #cbd5e1;
}

.chip-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.15);
}

/* Product Cards Grid */
.pos-items-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.item-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
  box-shadow: var(--shadow-xs);
}

.item-card:hover {
  transform: translateY(-3px);
  border-color: #bfdbfe;
  box-shadow: 0 10px 20px -3px rgba(37, 99, 235, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

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

.item-card.out-of-stock {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f8fafc;
  filter: grayscale(0.8);
}
.item-card.out-of-stock:hover {
  transform: none;
  box-shadow: var(--shadow-xs);
  border-color: var(--border-subtle);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.item-sku {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
}

.stock-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
}
.stock-tag.tag-normal {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #a7f3d0;
}
.stock-tag.tag-low {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecdd3;
}
.stock-tag.tag-service {
  background: var(--info-light);
  color: var(--info);
  border: 1px solid #bae6fd;
}

.item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}

.item-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.btn-add-item {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.item-card:hover .btn-add-item {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  transform: scale(1.05);
}

/* Right: Cart & Summary Side */
.pos-cart-panel {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cart-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
}

.cart-title {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.cart-item-count {
  font-size: 0.75rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.btn-clear-cart {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}
.btn-clear-cart:hover {
  color: var(--danger);
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #ffffff;
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  text-align: center;
  gap: 0.5rem;
}

.cart-item {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeIn 0.2s ease;
  transition: border-color 0.15s ease;
}

.cart-item:hover {
  border-color: #cbd5e1;
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cart-item-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
  padding-right: 0.5rem;
}

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

.cart-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.15rem;
  box-shadow: var(--shadow-xs);
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.qty-val {
  min-width: 28px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
}

.cart-item-subtotal {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
}

/* Cart Footer & Checkout */
.cart-footer {
  padding: 1.25rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  padding-top: 0.65rem;
  border-top: 1px dashed #cbd5e1;
}

.cart-total-amount {
  color: var(--primary);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.btn-checkout {
  width: 100%;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   MODUL 2: INVENTORY MANAGEMENT LAYOUT
   ========================================================================== */
.inventory-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.inventory-header-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
}

.inventory-title-group h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.inventory-title-group p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

.inventory-actions-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
  color: var(--text-main);
}

/* Modern Data Table */
.table-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.custom-table th {
  background: var(--bg-subtle);
  padding: 0.9rem 1.25rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-main);
}

.custom-table tbody tr {
  transition: background 0.15s ease;
}

.custom-table tbody tr:hover {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid #fde68a;
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecdd3;
}

.badge-info {
  background: var(--info-light);
  color: var(--info);
  border: 1px solid #bae6fd;
}

/* ==========================================================================
   MODUL 3: REPORT & ANALYTICS LAYOUT
   ========================================================================== */
.report-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.report-filter-bar {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
}

.period-switcher {
  display: flex;
  background: var(--bg-subtle);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.period-btn {
  padding: 0.45rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-btn:hover {
  color: var(--text-main);
}

.period-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* Summary Metric Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.revenue::before { background: var(--success); }
.stat-card.volume::before { background: var(--primary); }
.stat-card.ticket::before { background: var(--info); }

.stat-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.stat-card.revenue .stat-icon-wrapper { background: var(--success-light); color: var(--success); }
.stat-card.volume .stat-icon-wrapper { background: var(--primary-light); color: var(--primary); }
.stat-card.ticket .stat-icon-wrapper { background: var(--info-light); color: var(--info); }

.stat-meta h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.stat-meta .stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

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

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 520px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.6rem;
  max-height: 75vh;
  overflow-y: auto;
  background: #ffffff;
}

.modal-footer {
  padding: 1.1rem 1.6rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.7rem 0.95rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.925rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Quick Cash Buttons in Payment Modal */
.quick-cash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cash-chip {
  padding: 0.6rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.cash-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.15);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 280px;
  animation: slideInRight 0.25s ease;
}

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

.toast-success { border-left: 4px solid var(--success); }
.toast-danger { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

/* ==========================================================================
   DESAIN CETAK STRUK THERMAL & FORMATTING (Sesuai PRD Seksi 7)
   ========================================================================== */
#thermal-receipt {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }
  
  #thermal-receipt, #thermal-receipt * {
    visibility: visible;
  }

  #thermal-receipt {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 58mm;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.25;
    color: #000000;
    background: #ffffff;
    padding: 2mm;
    margin: 0;
  }

  .receipt-header, .receipt-footer {
    text-align: center;
  }

  .receipt-title {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  .receipt-subtitle {
    font-size: 10px;
    margin-bottom: 4px;
  }

  .receipt-divider {
    border-top: 1px dashed #000;
    margin: 4px 0;
  }

  .receipt-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
  }

  .receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0;
  }

  .receipt-table th, .receipt-table td {
    text-align: left;
    padding: 1px 0;
    font-size: 10px;
  }

  .receipt-table .text-right {
    text-align: right;
  }

  .receipt-total-row {
    font-weight: bold;
    font-size: 11px;
  }

  #print-logo {
    max-height: 48px;
    max-width: 160px;
    object-fit: contain;
    margin: 0 auto 4px auto;
  }
}

/* ==========================================================================
   MODUL 4: PENGATURAN TOKO & LOGO
   ========================================================================== */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.settings-header {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.6rem;
  box-shadow: var(--shadow-xs);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.settings-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-xs);
}

.settings-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

.logo-setting-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.logo-preview-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.logo-preview-box {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  border: 2px dashed #cbd5e1;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: all 0.2s ease;
}

.logo-preview-box:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.logo-preview-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.logo-preview-placeholder {
  font-size: 2.4rem;
  color: var(--primary);
  opacity: 0.8;
}

.logo-actions-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.logo-upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: var(--bg-subtle);
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.receipt-live-preview-box {
  background: #f1f5f9;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}

.simulated-receipt-paper {
  background: #ffffff;
  color: #000000;
  width: 100%;
  max-width: 270px;
  padding: 1.35rem 1.1rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.preview-receipt-title {
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 2px;
}

.preview-receipt-sub {
  text-align: center;
  font-size: 9.5px;
  color: #444;
}

.preview-receipt-divider {
  text-align: center;
  color: #888;
  margin: 4px 0;
  font-size: 9px;
  overflow: hidden;
  white-space: nowrap;
}

.preview-receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin: 1px 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET POS & MOBILE)
   ========================================================================== */

@media (max-width: 1024px) {
  .pos-container {
    grid-template-columns: 1fr 340px;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .nav-tabs {
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }
  .pos-container {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  .pos-items-grid {
    max-height: 400px;
  }
  .pos-cart-panel {
    height: 500px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
