:root {
  --primary: #0EA5E9;
  --secondary: #22C55E;
  --bg: #F8FAFC;
  --sidebar: #0F172A;
  --text: #1E293B;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Login */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--sidebar) 0%, #1e3a5f 50%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
  overflow: hidden;
  max-width: 420px;
  width: 100%;
}

.login-header {
  background: var(--sidebar);
  color: #fff;
  padding: 2rem;
  text-align: center;
}

.login-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.login-header .logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: .75rem;
}

/* App layout */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar);
  color: #94a3b8;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1040;
  transition: transform .3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.sidebar-brand span {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav { padding: 1rem 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.5rem;
  color: #94a3b8;
  text-decoration: none;
  transition: all .2s;
  font-size: .9rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
  background: rgba(14, 165, 233, .15);
  border-left: 3px solid var(--primary);
}

.sidebar-nav a i { width: 20px; text-align: center; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-navbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.content-area { padding: 1.5rem; flex: 1; }

/* Cards */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,.08);
}

.stat-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.stat-card .label {
  color: #64748b;
  font-size: .85rem;
}

.bg-primary-soft { background: rgba(14,165,233,.12); color: var(--primary); }
.bg-success-soft { background: rgba(34,197,94,.12); color: var(--secondary); }
.bg-warning-soft { background: rgba(245,158,11,.12); color: var(--warning); }
.bg-danger-soft { background: rgba(239,68,68,.12); color: var(--danger); }

/* Buttons */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #0284c7; border-color: #0284c7; }
.btn-success { background: var(--secondary); border-color: var(--secondary); }

/* Tables */
.table-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow: hidden;
}

.table-responsive { border-radius: 12px; }

.table thead th {
  background: #f1f5f9;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #64748b;
  border: none;
}

/* POS */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  min-height: calc(100vh - 120px);
}

.pos-products {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pos-cart-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
}

.category-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #e2e8f0;
}

.category-tabs .btn {
  border-radius: 20px;
  font-size: .85rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
  overflow-y: auto;
  flex: 1;
  padding: .25rem;
}

.product-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .75rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fff;
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(14,165,233,.2);
  transform: scale(1.02);
}

.product-card .price {
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
}

.product-card .name {
  font-size: .85rem;
  font-weight: 600;
  margin: .25rem 0;
}

.product-card .stall-badge {
  font-size: .65rem;
  color: #64748b;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .9rem;
}

.cart-footer {
  border-top: 2px solid #e2e8f0;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
}

.payment-section .btn-pay {
  font-size: 1.1rem;
  padding: .75rem;
  font-weight: 600;
}

.stall-subtotal {
  font-size: .8rem;
  color: #64748b;
  padding: .25rem .5rem;
  background: #f1f5f9;
  border-radius: 6px;
  margin: .25rem 0;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(14,165,233,.4);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Receipt */
.receipt-print {
  max-width: 320px;
  margin: 0 auto;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: #fff;
  padding: 1rem;
}

.receipt-print .logo { text-align: center; font-weight: bold; font-size: 16px; }
.receipt-print hr { border-style: dashed; }

/* Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .pos-layout { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .content-area { padding: 1rem; }
}

.badge-stall { background: rgba(14,165,233,.15); color: var(--primary); }
.page-title { font-weight: 700; color: var(--text); margin-bottom: 1.25rem; }

.notification-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

.chart-container { position: relative; height: 280px; }
