/* ==========================================================================
   TradePOS by Trade Digital - SAP Fiori Enterprise Light Theme
   Color Palette: Clean Off-White (#f4f6f9), Crisp Pure White Cards (#ffffff),
   SAP Fiori Horizon Blue Accent (#0a6ed1), SAP Quartz Dark Header (#1c2d42),
   Enterprise Typography & SAP-style Pill Badges & High Contrast Readability
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=72:wght@400;700&family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --bg-main: #f4f6f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-sidebar: #1c2d42; /* SAP Fiori Shell Dark Navy */
  --border-color: #e2e8f0;
  --border-glow: rgba(10, 110, 209, 0.3);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --primary: #0a6ed1; /* SAP Fiori Blue */
  --primary-hover: #0854a0;
  --primary-glow: rgba(10, 110, 209, 0.2);
  
  --accent-green: #107e3e; /* SAP Success Green */
  --accent-amber: #d97706; /* SAP Warning Amber */
  --accent-purple: #7c3aed;
  --accent-rose: #dc2626; /* SAP Error Red */
  --accent-cyan: #0284c7;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 15px rgba(10, 110, 209, 0.15);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
}

/* Sidebar Navigation - SAP Fiori Shell */
.app-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
}

.brand-header {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0a6ed1, #0854a0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(10, 110, 209, 0.4);
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.nav-list {
  list-style: none;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
}

.nav-link i {
  font-size: 18px;
  color: #94a3b8;
  transition: var(--transition);
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(10, 110, 209, 0.35);
  font-weight: 600;
}

.nav-link.active i {
  color: #ffffff;
}

/* User & Shift Widget */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
}

/* Main Content Area */
.app-main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - 260px);
  background-color: var(--bg-main);
}

.top-bar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.page-title {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
}

.top-right-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-shift {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 126, 62, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(16, 126, 62, 0.25);
}

.badge-shift.closed {
  background: rgba(220, 38, 38, 0.1);
  color: var(--accent-rose);
  border-color: rgba(220, 38, 38, 0.25);
}

/* Glass Card Component - Clean Enterprise SAP Light */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.glass-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* POS Layout (Split Register & Cart) */
.pos-container {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: calc(100vh - 64px);
  overflow: hidden;
}

.pos-catalog {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  background-color: var(--bg-main);
}

/* Category Filter Bar */
.category-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 4px 14px 4px;
  margin-bottom: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  scrollbar-width: thin;
}

.category-chip {
  padding: 9px 18px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.category-chip:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #f0f7ff;
}

.category-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(10, 110, 209, 0.3);
}

/* Product Tile Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
  padding-top: 4px;
}

.product-tile {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.product-tile:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(10, 110, 209, 0.12);
}

.product-tile:active {
  transform: scale(0.98);
}

.product-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #f1f5f9;
}

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.product-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-green);
  margin-top: auto;
}

.stock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  color: #fff;
}

.stock-badge.low {
  background: var(--accent-rose);
}

/* POS Cart Sidebar */
.pos-cart {
  background: #ffffff;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.03);
}

.cart-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

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

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.btn-qty {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: none;
  background: #f1f5f9;
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.cart-summary {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
}

.summary-row.total .price-tag {
  color: var(--accent-green);
}

/* Pay Button - SAP Signature Action Blue */
.btn-pay {
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #0a6ed1, #0854a0);
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(10, 110, 209, 0.3);
  transition: var(--transition);
}

.btn-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(10, 110, 209, 0.45);
  background: linear-gradient(135deg, #0854a0, #06407a);
}

.btn-pay:active {
  transform: scale(0.98);
}

/* Modals & Popups - Clean Light Enterprise Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  transform: scale(0.92);
  transition: var(--transition);
}

.modal-backdrop.show .modal-content {
  transform: scale(1);
}

/* Custom thermal receipt print styling */
.thermal-receipt {
  background: #ffffff;
  color: #000000;
  font-family: 'Courier New', Courier, monospace;
  width: 320px;
  padding: 20px;
  margin: 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.thermal-header {
  text-align: center;
  border-bottom: 1px dashed #000;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.thermal-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.thermal-total {
  border-top: 1px dashed #000;
  margin-top: 12px;
  padding-top: 8px;
  font-weight: bold;
}

/* Form Controls */
.form-control {
  width: 100%;
  padding: 11px 15px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 110, 209, 0.15);
}

/* Metric Stats Cards for Dashboard - SAP Style KPI Tile */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
