/* =====================================================
   YOYONG FLOWERSHOP - Global Stylesheet
   Palette: Lavender nav | Yellow-green accents | Floral warm
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary:      #C8A0E8;   /* lavender */
  --primary-dark: #A87CC8;
  --accent:       #D4F060;   /* yellow-green */
  --accent-dark:  #B8DC28;
  --bg-light:     #FFF9E6; /* warm pale yellow for content areas */
  --nav-bg:       #FFF6D6; /* pale warm nav background */
  --card-bg:      #FFFEF6; /* slightly off-white warm cards */
  --sidebar-bg:   #251133; /* slightly darker for contrast */
  --sidebar-text: #FFFFFF; /* ensure nav text is visible */
  --text-dark:    #1B2130; /* deep neutral for body text */
  --text-muted:   #6E6B78; /* slightly warmer muted color for readability */
  --white:        #FFFFFF;
  --border:       rgba(200,160,232,0.35);
  --shadow:       0 8px 32px rgba(100,50,180,0.13);
  --radius:       14px;
  --radius-sm:    8px;
  --transition:   all 0.28s cubic-bezier(.4,0,.2,1);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.55; /* improved readability */
  min-height: 100vh;
}

h1,h2,h3,h4,h5 { font-family: 'Playfair Display', serif; }

a { text-decoration: none; color: inherit; }

img { max-width: 100%; }

/* ── NAVBAR (guest) ── */
.navbar-guest {
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(100,50,180,0.1);
}
.navbar-guest .logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.5px;
}
.navbar-guest .logo span { color: var(--primary-dark); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: var(--transition);
  padding: 0.3rem 0;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-dark);
  transition: var(--transition);
}
.nav-links a:hover::after { width: 100%; }
.nav-search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0.35rem 1rem;
  gap: 0.5rem;
}
.nav-search-bar input {
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  outline: none;
  width: 220px; /* a little wider to allow typing without immediate wrap */
  transition: width 0.22s ease;
}
.nav-search-bar input:focus { width: 320px; }

/* ── NAVBAR (logged-in customer) ── */
.navbar-customer {
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(100,50,180,0.1);
}
.nav-customer-links { display: flex; align-items: center; gap: 0.2rem; list-style: none; }
.nav-customer-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dark);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-customer-links a:hover,
.nav-customer-links a.active {
  background: var(--accent);
  color: var(--text-dark);
}
.nav-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.4rem;
  border-radius: 50%;
  transition: var(--transition);
  position: relative;
}
.nav-icon-btn:hover { background: var(--accent); }
.badge {
  position: absolute;
  top: 0; right: 0;
  background: #E74C3C;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── HERO SECTION ── */
.hero {
  position: relative;
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1490750967868-88df5691cc96?w=1400&auto=format&fit=crop') center/cover no-repeat;
  filter: saturate(1.2);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,240,96,0.45) 0%, rgba(200,160,232,0.35) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 3.5rem;
  max-width: 520px;
}
.hero-content h1 {
  font-size: 3.2rem;
  line-height: 1.15;
  color: var(--text-dark);
  margin-bottom: 1.2rem;
}
.hero-content p {
  font-size: 1.05rem;
  color: #2D1B4E;
  margin-bottom: 2rem;
  opacity: 0.85;
}

/* ── FORMS (sign in / sign up) ── */
.auth-card {
  position: relative;
  z-index: 2;
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius);
  padding: 2.2rem 2rem;
  width: 420px;
  max-width: 95vw;
  box-shadow: 0 8px 30px rgba(20,20,40,0.06);
}
.auth-card h2 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 1.4rem;
  color: var(--text-dark);
}
.auth-card h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent-dark);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}
.form-group { margin-bottom: 0.85rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1.5fr 0.7fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 3px rgba(168,124,200,0.15);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--text-dark);
  box-shadow: 0 6px 18px rgba(168,124,200,0.08);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline {
  background: rgba(255,255,255,0.5);
  border: 1.5px solid var(--border);
  color: var(--text-dark);
}
.btn-outline:hover { background: rgba(255,255,255,0.8); }
.btn-dark {
  background: var(--sidebar-bg);
  color: var(--white);
}
.btn-dark:hover { background: #3D2B5E; }
.btn:not(.btn-sm) { width: 100%; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.form-group .btn-sm { 
  display: inline-block;
  margin-top: 0.3rem;
}
.btn-danger { background: #E74C3C; color: #fff; }
.btn-danger:hover { background: #C0392B; }
.btn-success { background: #27AE60; color: #fff; }
.btn-success:hover { background: #1E8449; }
.btn-info { background: #2980B9; color: #fff; }

.divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.8rem 0;
  position: relative;
}
.divider::before,.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

.auth-switch {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.auth-switch a { color: var(--primary-dark); font-weight: 600; }

/* ── HERO HOME LAYOUT ── */
.hero-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2rem 3.5rem;
  min-height: calc(100vh - 68px);
}

/* ── DASHBOARD LAYOUT (sidebar + content) ── */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
}
.sidebar-logo {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
}
.sidebar-logo .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 700;
}
.sidebar-logo .role-badge {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.sidebar-nav { flex: 1; padding: 0 0.8rem; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.72);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: var(--transition);
  background: transparent !important;
}
.sidebar-nav a:hover {
  background: rgba(212,240,96,0.12) !important;
  color: rgba(255,255,255,0.9);
}
.sidebar-nav a.active {
  background: rgba(212,240,96,0.25) !important;
  color: var(--accent) !important;
  font-weight: 600;
}
.sidebar-nav a .icon { font-size: 1.1rem; width: 22px; }
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.88rem;
  transition: var(--transition);
}
.sidebar-footer a:hover { color: #E74C3C; }

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-y: auto;
  background: var(--bg-light);
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1.5rem;
}
.page-header h1 { font-size: 1.7rem; margin: 0; }
.page-header h2 { font-size: 1.5rem; margin: 0; }
.page-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }
.page-header > button { flex-shrink: 0; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: 0 2px 12px rgba(100,50,180,0.08);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card.accent { border-left-color: var(--accent-dark); }
.stat-card.green  { border-left-color: #27AE60; }
.stat-card.red    { border-left-color: #E74C3C; }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem; }
.stat-card .value { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; color: var(--text-dark); }
.stat-card .sub   { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ── TABLES ── */
.table-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(100,50,180,0.08);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.table-card-header {
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #F0E8FF;
}
.table-card-header h3 { font-size: 1.05rem; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #F3F0FA; /* slightly stronger header background */
  padding: 1rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #4F4A5A; /* darker muted to improve contrast */
  text-align: left;
}
tbody td {
  padding: 1rem 1rem; /* more breathing room */
  font-size: 0.92rem; /* slightly larger for legibility */
  color: var(--text-dark);
  border-bottom: 1px solid #F4F2FA;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FBF7FF; }

/* ── STATUS BADGES ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pending   { background: #FFF3CD; color: #856404; }
.status-confirmed { background: #CCE5FF; color: #004085; }
.status-preparing { background: #E8D5FF; color: #5A0080; }
.status-delivered { background: #D4EDDA; color: #155724; }
.status-cancelled { background: #F8D7DA; color: #721C24; }
.status-paid      { background: #D4EDDA; color: #155724; }
.status-unpaid    { background: #F8D7DA; color: #721C24; }
.status-out_for_delivery { background: #D1ECF1; color: #0C5460; }

/* ── CARDS GRID (shop, products) ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.6rem;
  margin-bottom: 1.5rem;
}
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(100,50,180,0.08);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.product-card .img-wrap {
  height: 190px;
  background: linear-gradient(135deg, #F0E8FF, #E8FFCC);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-card .card-body { padding: 1rem 1.1rem; flex-grow: 1; }
.product-card .card-body h4 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.product-card .card-body .price {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.product-card .card-footer {
  padding: 0.8rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  border-top: 1px solid rgba(200, 160, 232, 0.2);
  margin-top: auto;
}

.product-card .card-footer form {
  display: flex;
  width: 100%;
}

.product-card .card-footer form:last-child {
  flex: 1 1 auto;
}

.product-card .card-footer form button {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── CATEGORY CARDS ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.category-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(100,50,180,0.07);
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}
.category-card:hover, .category-card.active {
  border-color: var(--primary);
  transform: translateY(-3px);
}
.category-card .cat-icon { font-size: 2.5rem; margin-bottom: 0.6rem; display: block; }
.category-card h3 { font-size: 0.95rem; font-weight: 600; }

/* ── CART ── */
.cart-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid #F0E8FF;
}
.cart-item:last-child { border-bottom: none; }
.cart-item .img { width: 60px; height: 60px; border-radius: 10px; background: linear-gradient(135deg,#F0E8FF,#E8FFCC); display:flex;align-items:center;justify-content:center;font-size:1.8rem;flex-shrink:0; }
.cart-item .info { flex: 1; }
.cart-item .info h4 { font-size: 0.92rem; margin-bottom: 0.3rem; }
.qty-control { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--bg-light);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}
.qty-btn:hover { background: var(--accent); border-color: var(--accent); }

/* ── ORDER SUMMARY ── */
.order-summary-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(100,50,180,0.08);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 0.8rem; font-size: 0.9rem; gap: 0.5rem; }
.summary-row.total { font-weight: 700; font-size: 1.05rem; border-top: 1px solid #F0E8FF; padding-top: 0.7rem; margin-top: 0.5rem; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(18,12,32,0.66); /* stronger dim to focus modal */
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 700px; /* slightly wider for better form layout */
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 100px rgba(20,20,40,0.15);
  transform: scale(0.98);
  transition: var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.8rem;
  border-bottom: 2px solid rgba(200,160,232,0.2);
  background: linear-gradient(135deg, rgba(212,240,96,0.05), rgba(200,160,232,0.05));
}
.modal-header h3 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; color: var(--text-muted);
  transition: var(--transition);
}
.modal-close:hover { color: #E74C3C; }
.modal-body { 
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-body .form-group { margin-bottom: 0; }
.modal-body .form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}
.modal-body .form-row { margin-bottom: 0; }
.modal-body > div[style*="background"] { 
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.modal-footer {
  padding: 1.2rem 1.8rem;
  border-top: 1px solid #F0E8FF;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  align-items: center;
}
.modal-footer .btn { margin: 0; }

/* ── ALERTS ── */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(18,12,32,0.48);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.app-confirm-overlay.open {
  opacity: 1;
  visibility: visible;
}
.app-confirm-dialog {
  width: min(390px, 100%);
  background: var(--card-bg);
  border: 1px solid rgba(200,160,232,0.28);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(20,20,40,0.22);
  padding: 1.2rem;
  transform: translateY(10px) scale(0.98);
  transition: var(--transition);
}
.app-confirm-overlay.open .app-confirm-dialog {
  transform: translateY(0) scale(1);
}
.app-confirm-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  background: rgba(212,240,96,0.45);
  color: var(--text-dark);
  font-weight: 800;
}
.app-confirm-icon.danger {
  background: #F8D7DA;
  color: #A93226;
}
.app-confirm-content h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 0.4rem;
  color: var(--text-dark);
}
.app-confirm-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-line;
}
.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.2rem;
}
.app-confirm-actions .btn {
  width: auto;
  min-width: 86px;
  margin: 0;
}

.alert {
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.alert-success { background: #D4EDDA; color: #155724; border-left: 4px solid #27AE60; }
.alert-error   { background: #F8D7DA; color: #721C24; border-left: 4px solid #E74C3C; }
.alert-info    { background: #CCE5FF; color: #004085; border-left: 4px solid #2980B9; }

/* ── SEARCH BAR ── */
.search-filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 1rem;
  min-width: 200px;
}
.search-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem 0.5rem; /* larger tap target */
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
}
.search-input-wrap span { color: var(--text-muted); }
.filter-select {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
}

/* ── CUSTOMIZE PAGE ── */
.customize-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}
.customize-preview {
  background: linear-gradient(135deg, #FFF9E6, #FFF6D6);
  border-radius: var(--radius);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  position: relative;
  overflow: hidden;
}
.chip-selector { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.chip {
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg-light);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.chip.selected { background: var(--accent); border-color: var(--accent-dark); font-weight: 600; }

/* ── PROFILE ── */
.profile-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 8px 30px rgba(20,20,40,0.06);
  max-width: 700px;
}
.profile-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: var(--white);
  margin: 0 auto 1.2rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

/* ── NOTIFICATION ITEMS ── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #F0E8FF;
  transition: var(--transition);
}
.notif-item:hover { background: #FBF7FF; }
.notif-item[onclick]:hover { background: #F0E8FF; cursor: pointer; }
.notif-item.unread { background: #F5EFFE; border-left: 3px solid var(--primary); }
.notif-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.notif-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.2rem; }
.notif-msg { font-size: 0.88rem; color: var(--text-muted); line-height:1.4 }
.notif-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }

/* Focus styles for accessibility */
a:focus, button:focus, input:focus, select:focus { outline: 3px solid rgba(168,124,200,0.15); outline-offset: 2px; }

/* ── SECTION TITLES ── */
.section-title {
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 1.3em;
  background: var(--accent-dark);
  border-radius: 3px;
}

/* ── CHART CONTAINER ── */
.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(100,50,180,0.08);
  margin-bottom: 1.5rem;
}
.chart-card h3 { font-size: 1rem; margin-bottom: 1rem; }

/* ── UTILITIES ── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 0.88rem; }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* =====================================================
   Responsive tweaks and mobile helpers
   - show/hide sidebar toggle on small screens
   - collapse nav to drawer on mobile
   - stack two-column layouts to single-column on small devices
 ===================================================== */

/* mobile nav toggle button (hidden by default) */
.nav-toggle { display: none; background: none; border: none; font-size: 1.35rem; cursor: pointer; padding: 0.25rem; }

@media (max-width: 1200px) {
  .navbar-guest, .navbar-customer { padding: 0 1.5rem; }
  .hero-content { padding: 2rem; }
  .hero-content h1 { font-size: 2.6rem; }
  .nav-search-bar input { width: 160px; }
  .hero-flex { padding: 1.6rem; }
  .product-card .img-wrap { height: 160px; }
}

@media (max-width: 900px) {
  /* Sidebar behaviour for admin pages: show toggle and collapse sidebar by default */
  #sidebar-toggle { display: block !important; }
  .sidebar { position: fixed; left: -260px; top: 0; height: 100vh; z-index: 10000; transition: left 0.25s ease; }
  .sidebar.open { left: 0; }
  .dashboard-layout { padding-left: 0; }
  .main-content { padding: 1rem; }

  /* Navbar adjustments: hide search and collapse menu to drawer */
  .nav-search-bar { display: none; }
  .nav-toggle { display: block; }
  .nav-customer-links { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--nav-bg); flex-direction: column; gap: 0; padding: 0.6rem 0.9rem; box-shadow: 0 8px 30px rgba(20,20,40,0.12); }
  .nav-customer-links.open { display: flex; }
  .nav-customer-links a { padding: 0.75rem 0.9rem; border-radius: 8px; }

  /* Layout stacks */
  .customize-layout, .cart-layout { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .modal { max-width: 95vw; margin: 0 0.5rem; }
  .order-summary-card { position: static; top: auto; margin-top: 1rem; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.8rem; }
  .hero-content p { font-size: 0.95rem; }
  .nav-customer-links a { font-size: 0.95rem; }
  .stat-card .value { font-size: 1.4rem; }
  .table-wrapper { font-size: 0.9rem; }
  .sidebar { width: 220px; }
}

/* utility: make tables and wrappers more forgiving on narrow screens */
.table-wrapper { -webkit-overflow-scrolling: touch; }


/* ==========================
   Responsive adjustments
   ========================== */
@media (max-width: 1024px) {
  .nav-search-bar input { width: 180px; }
  .hero-content { padding: 2rem; }
  .hero-content h1 { font-size: 2.4rem; }
  .hero-flex { padding: 1.2rem 1.5rem; }
  .sidebar { width: 220px; }
  .main-content { padding: 1.2rem; }
  .auth-card { width: 360px; }
}

@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .nav-links { display: none; }
  .nav-search-bar input { width: 120px; }
  .navbar-guest, .navbar-customer {
    padding: 0 0.8rem;
    height: 60px;
    gap: 0.45rem;
    min-width: 0;
  }
  .navbar-guest .logo {
    flex: 0 1 auto;
    min-width: 0;
  }
  .navbar-guest .logo img {
    height: 48px !important;
    max-width: 150px;
    object-fit: contain;
    margin-right: 0 !important;
  }
  .navbar-guest > .d-flex,
  .navbar-guest > div[style*="display:flex"] {
    flex: 0 0 auto;
    gap: 0.35rem !important;
    min-width: 0;
  }
  .nav-toggle {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    line-height: 1;
  }
  .nav-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    font-size: 1rem;
  }
  .hero-content { padding: 1.2rem; max-width: 95%; }
  .hero-content h1 { font-size: 1.8rem; }
  .hero-flex { flex-direction: column; gap: 1rem; padding: 1rem; min-height: auto; }
  .auth-card { width: 100%; padding: 1.2rem; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .dashboard-layout { flex-direction: column; }
  .page-header { flex-direction: column; align-items: flex-start; margin-bottom: 1.5rem; }
  .page-header > button { align-self: flex-start; width: auto; }
  /* Hide sidebar by default on small screens; will be toggled open with .open */
  .sidebar { width: 100%; display: none; flex-direction: column; overflow-x: visible; padding: 0; }
  .sidebar.open { display: flex; position: fixed; top: 52px; left: 0; right: 0; background: var(--sidebar-bg); padding: 1rem; z-index: 1200; box-shadow: 0 8px 40px rgba(0,0,0,0.18); }
  .sidebar-nav { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.3rem 0; }
  .sidebar-nav a { white-space: nowrap; padding: 0.6rem 0.8rem; }
  .main-content { padding: 1rem; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .product-card .img-wrap { height: 150px; }
  .product-card .card-footer { padding: 0.7rem 1rem; gap: 0.4rem; }
  .table-card { margin-bottom: 1rem; }
  .modal { max-width: 95%; margin: 0 0.5rem; }
  .customize-layout { grid-template-columns: 1fr; }
  .cart-layout { display: block; }

  .customer-home-hero {
    width: 100%;
    max-width: 100%;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 1.1rem !important;
    padding: 1.25rem 1rem !important;
    overflow: hidden;
  }

  .customer-home-intro,
  .customer-home-promo-wrap {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
  }

  .customer-home-intro {
    text-align: center;
  }

  .customer-home-intro h1 {
    font-size: 2rem !important;
    line-height: 1.15;
    margin-bottom: 0.65rem !important;
  }

  .customer-home-intro p {
    max-width: 24rem;
    margin: 0 auto 1rem !important;
    font-size: 0.98rem !important;
  }

  .customer-home-intro .btn {
    width: 100% !important;
    max-width: 230px;
    padding: 0.75rem 1rem !important;
    white-space: nowrap;
  }

  .customer-home-promo-card {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 300px;
    padding: 1.45rem 1rem !important;
    border-radius: 16px !important;
  }

  .customer-home-promo-card h2 {
    font-size: 1.9rem !important;
    line-height: 1.15;
    margin-bottom: 0.7rem !important;
  }

  .customer-home-promo-card p {
    font-size: 0.95rem !important;
    line-height: 1.45 !important;
    margin-bottom: 1rem !important;
  }

  .customer-home-promo-card .btn {
    width: 100% !important;
    max-width: 230px;
    padding: 0.75rem 1rem !important;
  }

  .customer-home-section {
    width: 100%;
    max-width: 100%;
    padding: 1.6rem 1rem !important;
    overflow: hidden;
  }

  .customer-home-section .section-title {
    font-size: 1.35rem !important;
    margin-bottom: 1rem !important;
  }

  .customer-home-section .products-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100%;
  }

  .customer-home-section .product-card {
    width: 100%;
    max-width: 100%;
  }

  .customer-home-section .product-card .img-wrap {
    height: 190px !important;
  }

  .customer-home-section .product-card .card-footer {
    flex-direction: row !important;
    align-items: stretch !important;
  }

  .customer-home-section .product-card .card-footer > .btn {
    flex: 0 0 88px;
  }

  .customer-home-customize {
    padding: 1.3rem !important;
    align-items: flex-start !important;
  }

  .customer-home-customize h2 {
    font-size: 1.35rem;
    line-height: 1.2;
  }

  .customer-home-customize .btn {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .nav-search-bar { display: none; }
  .badge { width: 14px; height: 14px; font-size: 0.6rem; }
  .products-grid { grid-template-columns: 1fr; gap: 1rem; }
  .product-card .img-wrap { height: 120px; font-size: 2.2rem; }
  .product-card .card-footer { padding: 0.6rem 0.9rem; gap: 0.35rem; }
  .product-card .card-footer form button { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
  .hero-content h1 { font-size: 1.6rem; }
  .page-header h1 { font-size: 1.2rem; }
  .page-header h2 { font-size: 1.1rem; }
  .stat-card .value { font-size: 1.4rem; }
  table thead th { display: none; }
  tbody td { display: block; padding: 0.7rem 0.6rem; }
  tbody td:first-child { padding-top: 0.8rem; }
  tbody tr { border-bottom: 1px solid #F4F2FA; display: block; margin-bottom: 0.6rem; }
  .table-wrapper { overflow-x: visible; }
  .form-control { padding: 0.6rem 0.8rem; }
  .btn { padding: 0.6rem 0.9rem; font-size: 0.9rem; }

  .navbar-guest .logo img {
    height: 44px !important;
    max-width: 132px;
  }

  .navbar-guest,
  .navbar-customer {
    padding: 0 0.65rem;
  }

  .nav-icon-btn {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .nav-toggle {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .customer-home-hero {
    padding: 1rem 0.85rem !important;
  }

  .customer-home-intro h1 {
    font-size: 1.75rem !important;
  }

  .customer-home-promo-card {
    min-height: 270px;
    padding: 1.2rem 0.85rem !important;
  }

  .customer-home-promo-card h2 {
    font-size: 1.55rem !important;
  }

  .customer-home-section {
    padding: 1.35rem 0.85rem !important;
  }

  .customer-home-section .product-card .img-wrap {
    height: 170px !important;
  }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ── ANIMATIONS ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.5s ease forwards; }

@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.pulse { animation: pulse 2s infinite; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-flex { flex-direction: column; gap: 2rem; padding: 2rem 1.5rem; }
  .auth-card { width: 100%; }
  .categories-grid { grid-template-columns: repeat(2,1fr); }
  .cart-layout { grid-template-columns: 1fr; }
  .customize-layout { grid-template-columns: 1fr; }
  .sidebar { width: 220px; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .categories-grid { grid-template-columns: repeat(2,1fr); }
  .main-content { padding: 1.2rem; }
  .navbar-customer { padding: 0 1rem; }
}

/* =====================================================
   SIDEBAR SECTION LABELS (v2 update)
   ===================================================== */
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  padding: 1rem 1.2rem 0.3rem;
  margin-top: 0.4rem;
}
