:root {
  --green: #2E7D32;
  --green-dark: #1B5E20;
  --green-light: #E8F5E9;
  --red: #D32F2F;
  --red-dark: #B71C1C;
  --yellow: #FFC107;
  --cream: #FFFBF0;
  --beige: #FFF8E1;
  --gray: #616161;
  --dark: #212121;
  --off-white: #FAFAFA;
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Nunito', sans-serif;
  color: var(--dark);
  background: var(--cream);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Fredoka', sans-serif; }
a { color: var(--green); text-decoration: none; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 3px solid var(--red);
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.topbar-logo { display: flex; align-items: center; gap: 8px; }
.topbar-logo img { height: 36px; }
.topbar-logo span { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 1.1rem; color: var(--green); }
.topbar-nav { display: flex; gap: 4px; }
.topbar-nav a {
  padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 0.85rem;
  color: var(--green); transition: all 0.2s;
}
.topbar-nav a:hover, .topbar-nav a.active { background: var(--green); color: #fff; }

/* Bottom nav (mobile) */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: #fff; border-top: 1px solid #e0e0e0;
  display: flex; justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 0.7rem; font-weight: 600; color: var(--gray);
  padding: 4px 12px; border-radius: 8px; transition: color 0.2s;
}
.bottom-nav a .nav-icon { font-size: 1.3rem; }
.bottom-nav a.active { color: var(--green); }

/* Content */
.page-content {
  max-width: 600px; margin: 0 auto;
  padding: 16px 16px 80px;
}

/* Cards */
.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px;
  margin-bottom: 12px; transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff; padding: 14px 20px; border-radius: var(--radius);
  margin-bottom: 20px; text-align: center;
}
.hero h1 { font-size: 1.6rem; margin-bottom: 6px; }
.hero p { opacity: 0.9; font-size: 0.95rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 24px; border-radius: 10px; font-weight: 700;
  font-size: 0.95rem; border: none; cursor: pointer;
  transition: all 0.2s; font-family: 'Nunito', sans-serif;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); transform: translateY(-2px); }
.btn-outline {
  background: transparent; color: var(--green);
  border: 2px solid var(--green);
}
.btn-outline:hover { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* Tags */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tag-deal { background: var(--yellow); color: var(--dark); }
.tag-update { background: var(--green-light); color: var(--green); }
.tag-exclusive { background: var(--red); color: #fff; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-weight: 700; font-size: 0.85rem;
  margin-bottom: 4px; color: var(--green);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 2px solid #e0e0e0;
  border-radius: 10px; font-size: 1rem; font-family: 'Nunito', sans-serif;
  transition: border-color 0.2s; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--green);
}
.form-group textarea { resize: vertical; min-height: 70px; }

/* Product picker */
.product-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 2px solid #e0e0e0; border-radius: var(--radius);
  padding: 14px; margin-bottom: 8px; transition: border-color 0.2s;
}
.product-card.selected { border-color: var(--green); background: var(--green-light); }
.product-emoji { font-size: 2rem; }
.product-info { flex: 1; }
.product-info .name { font-weight: 700; font-size: 1rem; }
.product-info .unit { font-size: 0.8rem; color: var(--gray); }
.qty-control {
  display: flex; align-items: center; gap: 8px;
}
.qty-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--green); background: #fff; color: var(--green);
  font-size: 1.2rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.qty-btn:hover { background: var(--green); color: #fff; }
.qty-value {
  font-weight: 700; font-size: 1.1rem; min-width: 28px; text-align: center;
}

/* Status chips */
.status {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
}
.status-pending { background: #FFF3E0; color: #E65100; }
.status-confirmed { background: #E3F2FD; color: #1565C0; }
.status-ready { background: var(--green-light); color: var(--green); }
.status-picked_up { background: #F3E5F5; color: #7B1FA2; }
.status-cancelled { background: #FFEBEE; color: var(--red); }

/* Action cards */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.action-card {
  background: #fff; border-radius: var(--radius); padding: 20px 14px;
  text-align: center; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: all 0.2s; text-decoration: none; color: var(--dark);
}
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.action-card .icon { font-size: 2rem; margin-bottom: 6px; }
.action-card .label { font-weight: 700; font-size: 0.9rem; }

/* Section header */
.section-header {
  display: flex; align-items: center; gap: 8px;
  margin: 20px 0 10px; padding-bottom: 6px;
}
.section-header h2 { font-size: 1.1rem; color: var(--green); }

/* Update cards */
.update-card { padding: 16px; }
.update-card .meta { font-size: 0.75rem; color: var(--gray); margin-top: 8px; }
.update-card h3 { font-size: 1rem; margin: 6px 0; }
.update-card p { font-size: 0.9rem; color: var(--gray); line-height: 1.5; }

/* Modal / overlay */
.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: #fff; border-radius: 20px 20px 0 0;
  width: 100%; max-width: 600px; max-height: 85vh;
  overflow-y: auto; padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
}
.modal h2 { font-size: 1.2rem; margin-bottom: 16px; }

/* Success screen */
.success-screen {
  text-align: center; padding: 40px 20px;
}
.success-screen .check { font-size: 4rem; margin-bottom: 12px; }
.success-screen h2 { color: var(--green); margin-bottom: 8px; }

/* Admin specific */
.admin-tabs {
  display: flex; gap: 4px; margin-bottom: 16px; background: #fff;
  border-radius: 10px; padding: 4px; box-shadow: var(--shadow-sm);
}
.admin-tab {
  flex: 1; padding: 10px; text-align: center; border-radius: 8px;
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
  border: none; background: transparent; color: var(--gray);
  font-family: 'Nunito', sans-serif; transition: all 0.2s;
}
.admin-tab.active { background: var(--green); color: #fff; }

/* Order detail in admin */
.order-card { position: relative; }
.order-card .order-header {
  display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px;
}
.order-card .customer { font-weight: 700; }
.order-card .detail { font-size: 0.85rem; color: var(--gray); margin: 2px 0; }
.order-items-list { margin: 10px 0; padding: 10px; background: var(--off-white); border-radius: 8px; }
.order-items-list li { list-style: none; padding: 3px 0; font-size: 0.9rem; }

/* Notification badge */
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: 0.65rem;
  font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; display: flex; align-items: center;
  justify-content: center; padding: 0 4px;
}

/* Status select */
.status-select {
  padding: 4px 8px; border-radius: 8px; border: 2px solid #e0e0e0;
  font-size: 0.8rem; font-weight: 600; font-family: 'Nunito', sans-serif;
  cursor: pointer;
}

/* Hide desktop nav on mobile, show bottom nav */
@media (max-width: 640px) {
  .topbar-nav { display: none; }
}
@media (min-width: 641px) {
  .bottom-nav { display: none; }
  .page-content { padding-bottom: 40px; }
}

/* Rich text content from Quill editor */
.rich-content { font-size: 0.9rem; color: var(--gray); line-height: 1.6; }
.rich-content p { margin-bottom: 8px; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content img {
  max-width: 100%; height: auto;
  border-radius: 10px; margin: 8px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.rich-content h1, .rich-content h2, .rich-content h3 {
  color: var(--dark); margin: 12px 0 6px;
}
.rich-content h1 { font-size: 1.3rem; }
.rich-content h2 { font-size: 1.1rem; }
.rich-content h3 { font-size: 1rem; }
.rich-content ul, .rich-content ol { margin: 6px 0; padding-left: 24px; }
.rich-content li { margin-bottom: 4px; }
.rich-content a { color: var(--green); text-decoration: underline; }
.rich-content strong { color: var(--dark); }
.rich-content blockquote {
  border-left: 3px solid var(--green); padding-left: 12px;
  margin: 8px 0; font-style: italic; color: var(--gray);
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
