:root {
  /* Dark Glassmorphism Theme */
  --bg-color: #0b1120;
  --panel-bg: rgba(30, 41, 59, 0.7);
  --panel-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --font-family: 'Inter', sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-color);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Glass Panels */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--glass-shadow);
}

.glass-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
}

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

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.primary-btn {
  background: var(--primary);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.btn-large {
  padding: 16px 24px;
  font-size: 1.1rem;
  width: 100%;
}

/* Login Screen */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 20px;
}

.login-card {
  padding: 48px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(to right, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 12px;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.login-card .primary-btn {
  background: white;
  color: #1e293b;
  width: 100%;
}
.login-card .primary-btn:hover {
  background: #f8fafc;
}

/* App Layout - iPad Proportions */
.app-layout {
  display: grid;
  grid-template-columns: 80px 1fr 380px;
  height: 100vh;
  gap: 16px;
  padding: 16px;
}

/* Sidebar */
.sidebar {
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
}

.sidebar-header .logo-small {
  font-weight: 700;
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 40px;
  background: rgba(59, 130, 246, 0.2);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  align-items: center;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.nav-btn.active {
  background: var(--primary);
  color: white;
}

.text-danger:hover {
  color: var(--danger);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.user-profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  overflow-y: auto;
  padding-right: 8px; /* For scrollbar */
}
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 10px; }

.top-bar {
  border-radius: var(--radius-md);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-wrapper {
  position: relative;
  width: 60%;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

#search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 12px 16px 12px 48px;
  color: var(--text-main);
  font-size: 16px;
  transition: all 0.2s;
}

#search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
}

.cashier-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
}

.categories {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-chip {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.category-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.category-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.2);
}

.product-card:active {
  transform: translateY(0) scale(0.98);
}

.product-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  font-size: 40px;
}

.product-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.product-info .price {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

.product-card.out-of-stock {
  opacity: 0.5;
  pointer-events: none;
}

/* Cart Panel */
.cart-panel {
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-header {
  padding: 24px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.order-id {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-track { background: transparent; }
.cart-items::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 10px; }

.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(0,0,0,0.15);
  border-radius: 12px;
  padding: 12px;
  animation: fadeIn 0.3s ease-out;
}

.cart-item-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.cart-item-info h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.cart-item-info .item-price {
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}

.qty-btn:hover {
  background: rgba(255,255,255,0.1);
}

.qty {
  width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.cart-summary {
  padding: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--panel-border);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 15px;
}

.summary-line.total {
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin-bottom: 0;
}

#total-amt {
  color: var(--primary);
}

.summary-divider {
  border: 0;
  height: 1px;
  background: var(--panel-border);
  margin: 16px 0;
}

.cart-actions {
  padding: 0 24px 24px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 12px;
}

.cart-actions .secondary-btn {
  flex: 1;
}

.cart-actions .primary-btn {
  flex: 2;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
  visibility: visible;
}

.toast.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 20px);
}

.toast-content {
  background: var(--success);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsiveness (Though target is iPad landscape, fallback for smaller screens) */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 70px 1fr 320px;
  }
}
