:root {
  --primary: #e67e22;
  --primary-dark: #d35400;
  --secondary: #f39c12;
  --bg: #fef9f3;
  --card: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --success: #27ae60;
  --danger: #e74c3c;
  --border: #eee;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 70px;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header h1 { font-size: 18px; font-weight: 700; }
.header .back-btn { background: none; border: none; color: white; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.header .admin-link { background: rgba(255,255,255,0.2); border: none; color: white; padding: 6px 12px; border-radius: 16px; font-size: 12px; cursor: pointer; }

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: white;
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 100;
}
.bottom-nav button {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bottom-nav button.active { color: var(--primary); }
.bottom-nav button .icon { font-size: 20px; }

/* Page */
.page { display: none; padding: 16px; }
.page.active { display: block; }

/* Cards */
.card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.card-img { width: 100%; height: 180px; object-fit: cover; }
.card-body { padding: 14px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.card-desc { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.card-price { font-size: 15px; font-weight: 600; color: var(--primary); }

/* Progress bar */
.progress-container { margin: 8px 0; }
.progress-bar { background: #eee; border-radius: 10px; height: 10px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, var(--primary), var(--secondary)); height: 100%; border-radius: 10px; transition: width 0.5s; }
.progress-text { font-size: 12px; color: var(--text-light); margin-top: 4px; display: flex; justify-content: space-between; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #ecf0f1; color: var(--text); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-light); }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.form-control:focus { border-color: var(--primary); }
select.form-control { appearance: none; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center; }

/* Badge */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-collecting { background: #fff3cd; color: #856404; }
.badge-producing { background: #cce5ff; color: #004085; }
.badge-ready { background: #d4edda; color: #155724; }
.badge-completed { background: #e2e3e5; color: #383d41; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-confirmed { background: #cce5ff; color: #004085; }
.badge-collected { background: #d4edda; color: #155724; }
.badge-delivered { background: #d4edda; color: #155724; }
.badge-closed { background: #f8d7da; color: #721c24; }

/* Login */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 20px;
  text-align: center;
}
.login-container .logo { font-size: 48px; margin-bottom: 8px; }
.login-container h2 { margin-bottom: 4px; font-size: 22px; }
.login-container p { color: var(--text-light); margin-bottom: 24px; font-size: 14px; }
.login-container .form-group { width: 100%; }

/* Quantity selector */
.qty-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}
.qty-selector button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-selector span { font-size: 16px; font-weight: 600; min-width: 30px; text-align: center; }

/* Variant picker */
.variant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.variant-item:last-child { border-bottom: none; }
.variant-info .variant-name { font-size: 14px; font-weight: 500; }
.variant-info .variant-price { font-size: 13px; color: var(--primary); font-weight: 600; }

/* Order status timeline */
.status-steps { display: flex; justify-content: space-between; margin: 16px 0; position: relative; }
.status-steps::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #eee;
}
.status-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: var(--text-light);
  position: relative;
  z-index: 1;
}
.status-step .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eee;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.status-step.active .dot { background: var(--primary); color: white; }
.status-step.done .dot { background: var(--success); color: white; }

/* Admin */
.admin-header { background: linear-gradient(135deg, #2c3e50, #3498db); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card { background: white; border-radius: 10px; padding: 14px; box-shadow: var(--shadow); text-align: center; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 11px; color: var(--text-light); text-transform: uppercase; }

/* Table */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #f8f9fa; padding: 8px; text-align: left; font-weight: 600; }
td { padding: 8px; border-bottom: 1px solid var(--border); }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Toast */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}
.toast.show { opacity: 1; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
}
.modal h3 { margin-bottom: 16px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
