:root {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --accent: #38bdf8;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --success: #16a34a;
  --warning: #ca8a04;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(2, 132, 199, 0.08);
  --shadow-lg: 0 10px 25px rgba(2, 132, 199, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Mobile Container */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* Header */
.app-header {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Content Area */
.app-content {
  flex: 1;
  padding: 16px 20px 80px;
}

/* Dashboard Cards */
.status-banner {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: #ffffff;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.status-banner::after {
  content: "💧";
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-size: 100px;
  opacity: 0.15;
  pointer-events: none;
}

.user-greeting {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.user-name {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(255, 255, 255, 0.15);
  padding: 12px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  opacity: 0.85;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
}

.badge-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #f1f5f9; color: #475569; }

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Reorder Quick Card */
.reorder-card {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reorder-details {
  font-size: 13px;
  color: #166534;
}

.reorder-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 2px;
}

/* Product Cards */
.product-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.product-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.product-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.price-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.price-box {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.price-box.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

.price-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.price-box.selected .price-box-title {
  color: var(--primary);
}

.price-box-amount {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

/* Quantity Control */
.qty-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 38px;
  height: 38px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-val {
  width: 34px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
}

/* Primary Buttons */
.btn-primary {
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
  width: auto;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 0;
  z-index: 50;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
  cursor: pointer;
  min-height: 48px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  font-size: 19px;
}

/* Floating Cart Bar */
.cart-floating-bar {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  z-index: 45;
  cursor: pointer;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 40px;
  max-height: 90vh;
  overflow-y: auto;
  animation: sheetUp 0.25s ease-out;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Order Status Banner */
.order-status-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.order-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-new { background: #e0f2fe; color: #0369a1; }
.status-confirmed { background: #fef3c7; color: #92400e; }
.status-preparing { background: #fef08a; color: #854d0e; }
.status-out_for_delivery { background: #fed7aa; color: #9a3412; }
.status-delivered { background: #dcfce7; color: #166534; }
