:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
}

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

html, body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Splash Screen */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-gradient);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.6s ease, visibility 0.6s;
}

#splash img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 8px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* Main Container */
.container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-secondary);
}

/* Header */
.header {
  background: var(--bg-primary);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}

.header h1 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  letter-spacing: -0.5px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  gap: 20px;
  padding: 20px;
  overflow: hidden;
  min-height: 0;
}

/* Products Section */
.products-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  padding-right: 12px;
  align-items: stretch; /* Make all cards same height */
  width: 100%; /* Full width */
  box-sizing: border-box;
  grid-auto-rows: 1fr; /* Make rows equal height */
}

.products-grid::-webkit-scrollbar {
  width: 6px;
}

.products-grid::-webkit-scrollbar-track {
  background: transparent;
}

.products-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.products-grid::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Product Card */
.product-card {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  height: 100%; /* Full height */
  min-height: 100%; /* Ensure minimum full height */
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bg-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-image {
  width: 100%;
  height: auto;
  min-height: 180px;
  max-height: 250px;
  object-fit: contain;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  flex-shrink: 0;
}

.product-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-primary);
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.qty-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-input {
  width: 70px;
  padding: 8px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.qty-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.add-cart-btn {
  width: 100%;
  padding: 14px;
  background: var(--bg-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  margin-top: auto; /* Push button to bottom */
  flex-shrink: 0;
}

.add-cart-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.add-cart-btn:hover::before {
  width: 300px;
  height: 300px;
}

.add-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.add-cart-btn:active {
  transform: translateY(0);
}

.add-cart-btn span {
  position: relative;
  z-index: 1;
}

/* Cart Section */
.cart-section {
  width: 380px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-gradient);
  color: white;
}

.cart-header h2 {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-header .cart-icon {
  font-size: 28px;
}

.cart-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0;
}

.cart-items::-webkit-scrollbar {
  width: 6px;
}

.cart-items::-webkit-scrollbar-track {
  background: transparent;
}

.cart-items::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.cart-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.cart-empty-text {
  font-size: 16px;
  font-weight: 500;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cart-item:hover {
  background: #f1f5f9;
  transform: translateX(4px);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.cart-item-details {
  font-size: 14px;
  color: var(--text-secondary);
}

.cart-item-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-right: 12px;
}

.remove-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.cart-footer {
  padding: 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 2px solid var(--primary);
}

.cart-total-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cart-total-amount {
  font-size: 28px;
  font-weight: 700;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cart-actions {
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--bg-gradient);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
  background: var(--bg-primary);
  color: var(--danger);
  border: 2px solid var(--danger);
}

.btn-secondary:hover {
  background: var(--danger);
  color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-content {
    flex-direction: column;
    padding: 16px;
  }

  .cart-section {
    width: 100%;
    max-height: 40vh;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    align-items: stretch;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 16px;
  }

  .main-content {
    padding: 12px;
    gap: 16px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 4px;
    align-items: stretch;
    width: 100%;
  }

  .product-card {
    padding: 16px;
    height: 100%;
    width: 100%;
  }

  .product-image {
    min-height: 120px;
    max-height: 180px;
  }

  .cart-section {
    max-height: 45vh;
  }

  .cart-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
    width: 100%;
  }
  
  .product-card {
    height: 100%;
    width: 100%;
  }
  
  .product-image {
    min-height: 150px;
    max-height: 200px;
  }

  .header h1 {
    font-size: 22px;
  }

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

/* Loading Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeIn 0.5s ease backwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }

/* Custom Modal for Serial Port Connection */
.serial-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.serial-modal.show {
  display: flex;
}

.serial-modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  animation: slideUp 0.3s ease;
}

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

.serial-modal h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.serial-modal p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.serial-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.serial-modal-btn {
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.serial-modal-btn-primary {
  background: var(--bg-gradient);
  color: white;
  box-shadow: var(--shadow);
}

.serial-modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.serial-modal-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.serial-modal-btn-secondary:hover {
  background: var(--border);
}

/* Machine Log Modal Styles */
.machine-log-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10002;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.machine-log-modal.show {
  display: flex;
}

.machine-log-modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 20px;
  padding: 0;
  max-width: 700px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.3);
  animation: slideUpSuccess 0.4s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.machine-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.machine-log-header h3 {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.machine-log-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.machine-log-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.machine-log-body {
  display: none; /* Hidden - only showing progress bar */
}

.machine-log-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.machine-log-entry {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  animation: slideInLog 0.3s ease;
  word-wrap: break-word;
}

.machine-log-entry.machine-log-info {
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid #3b82f6;
  color: #93c5fd;
}

.machine-log-entry.machine-log-success {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid #10b981;
  color: #6ee7b7;
  font-weight: 600;
}

.machine-log-entry.machine-log-error {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  color: #fca5a5;
}

.machine-log-entry.machine-log-sent {
  background: rgba(139, 92, 246, 0.1);
  border-left: 3px solid #8b5cf6;
  color: #c4b5fd;
}

.machine-log-time {
  color: #64748b;
  font-size: 0.8rem;
  min-width: 80px;
  flex-shrink: 0;
}

.machine-log-message {
  flex: 1;
  font-family: 'Courier New', monospace;
}

.machine-log-footer {
  padding: 2.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

.machine-log-status {
  text-align: center;
}

.machine-log-status-text {
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 500;
}

.machine-log-status-text.success {
  color: #10b981;
  font-weight: 600;
}

.machine-log-status-text.error {
  color: #ef4444;
}

/* Machine Log Progress Bar */
.machine-log-progress-container {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.machine-log-progress-product {
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.machine-log-progress-product span {
  color: #e2e8f0;
  font-size: 1.2rem;
  font-weight: 600;
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.machine-log-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #e2e8f0;
  font-weight: 500;
}

.machine-log-progress-label span:first-child {
  color: #94a3b8;
  font-size: 1rem;
}

.machine-log-progress-label span:last-child {
  color: #10b981;
  font-weight: 700;
  font-size: 1.5rem;
}

.machine-log-progress-bar {
  width: 100%;
  height: 24px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(99, 102, 241, 0.3);
  position: relative;
}

.machine-log-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
  border-radius: 6px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  position: relative;
  overflow: hidden;
}

.machine-log-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes slideInLog {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Dispense Success Modal Styles */
.dispense-success-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10001;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.dispense-success-modal.show {
  display: flex;
}

.dispense-success-modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(16, 185, 129, 0.3);
  animation: slideUpSuccess 0.4s ease;
  text-align: center;
}

.dispense-success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: scaleIn 0.5s ease;
}

.dispense-success-modal h3 {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dispense-order-details {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.dispense-order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dispense-order-item:last-child {
  border-bottom: none;
}

.dispense-order-item-name {
  color: #e2e8f0;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  flex: 1;
}

.dispense-order-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  margin: 0 1rem;
}

.dispense-order-item-qty {
  color: #94a3b8;
  font-size: 0.9rem;
}

.dispense-order-item-weight {
  color: #10b981;
  font-size: 0.9rem;
  font-weight: 600;
}

.dispense-order-item-price {
  color: #10b981;
  font-size: 1rem;
  font-weight: 600;
  text-align: right;
}

.dispense-order-total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid rgba(16, 185, 129, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dispense-order-total-label {
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 600;
}

.dispense-order-total-amount {
  color: #10b981;
  font-size: 1.3rem;
  font-weight: 700;
}

.dispense-order-total-weight {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dispense-order-total-weight-label {
  color: #94a3b8;
  font-size: 1rem;
  font-weight: 500;
}

.dispense-order-total-weight-amount {
  color: #34d399;
  font-size: 1.2rem;
  font-weight: 700;
}

.dispense-success-footer {
  margin-top: 1.5rem;
}

.dispense-success-btn {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: #fff;
  border: none;
  padding: 0.875rem 2.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.dispense-success-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.dispense-success-btn:active {
  transform: translateY(0);
}

/* Dispense Aborted Modal Styles */
.dispense-aborted-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10003;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.dispense-aborted-modal.show {
  display: flex;
}

.dispense-aborted-modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: slideUpSuccess 0.4s ease;
  text-align: center;
}

.dispense-aborted-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: scaleIn 0.5s ease;
}

.dispense-aborted-modal h3 {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dispense-aborted-message {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.aborted-message-text {
  color: #e2e8f0;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.aborted-message-text p {
  margin: 0.5rem 0;
}

.aborted-message-text strong {
  color: #fbbf24;
  font-weight: 600;
}

.aborted-product-info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.95rem;
}

.aborted-product-info p {
  margin: 0.5rem 0;
}

.aborted-product-info strong {
  color: #e2e8f0;
}

.dispense-aborted-footer {
  margin-top: 1.5rem;
}

.dispense-aborted-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #fff;
  border: none;
  padding: 0.875rem 2.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.dispense-aborted-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.dispense-aborted-btn:active {
  transform: translateY(0);
}

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

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

/* Custom Alert Modal */
.custom-alert-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  animation: fadeIn 0.3s ease;
}

.custom-alert-modal.show {
  display: flex;
}

.custom-alert-modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.3s ease;
  text-align: center;
}

.custom-alert-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
}

.custom-alert-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.custom-alert-message {
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

.custom-alert-message strong {
  color: #fff;
  font-weight: 600;
}

.custom-alert-footer {
  margin-top: 1.5rem;
}

.custom-alert-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  padding: 0.875rem 2.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  min-width: 120px;
}

.custom-alert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.custom-alert-btn:active {
  transform: translateY(0);
}

/* Alert types */
.custom-alert-modal.success .custom-alert-icon {
  color: #10b981;
}

.custom-alert-modal.error .custom-alert-icon {
  color: #ef4444;
}

.custom-alert-modal.warning .custom-alert-icon {
  color: #f59e0b;
}

.custom-alert-modal.info .custom-alert-icon {
  color: #3b82f6;
}

.custom-alert-modal.success .custom-alert-btn {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.custom-alert-modal.error .custom-alert-btn {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.custom-alert-modal.warning .custom-alert-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
