:root {
  --primary: #2d8a4e;
  --primary-dark: #1f6b3a;
  --primary-light: #e8f5ee;
  --secondary: #f59e0b;
  --danger: #ef4444;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --bg: #fff;
  --bg-light: #f8faf9;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,.06);
  --shadow-hover: 0 8px 30px rgba(0,0,0,.1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Hind Siliguri', sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: .25s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; border: none; outline: none; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 24px; border-radius: 50px; font-weight: 600; cursor: pointer; transition: .25s; border: 2px solid transparent; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-block { width: 100%; }

/* Header */
.header { position: sticky; top: 0; z-index: 1000; background: #fff; box-shadow: 0 2px 15px rgba(0,0,0,.06); }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; }
.logo a { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; font-weight: 600; }
.logo i { color: var(--primary); font-size: 1.5rem; }
.search-box { flex: 1; max-width: 420px; display: flex; background: var(--bg-light); border-radius: 50px; border: 1px solid var(--border); overflow: hidden; }
.search-box input { flex: 1; padding: 10px 18px; background: transparent; }
.search-box button { padding: 0 18px; background: var(--primary); color: #fff; cursor: pointer; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.user-btn, .cart-btn { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 50px; background: var(--primary-light); color: var(--primary); font-weight: 500; font-size: .9rem; }
.cart-btn { position: relative; width: 42px; height: 42px; justify-content: center; padding: 0; border-radius: 50%; }
.cart-count { position: absolute; top: -4px; right: -4px; background: var(--secondary); color: #fff; font-size: .7rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.menu-toggle { display: none; width: 40px; height: 40px; background: var(--bg-light); border-radius: 8px; cursor: pointer; font-size: 1.1rem; }
.nav { background: var(--primary); }
.nav ul { display: flex; flex-wrap: wrap; }
.nav a { display: block; padding: 11px 16px; color: rgba(255,255,255,.9); font-weight: 500; font-size: .92rem; }
.nav a:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Flash */
.flash { position: fixed; top: 80px; right: 20px; z-index: 3000; padding: 14px 20px; border-radius: 10px; color: #fff; font-weight: 500; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-hover); animation: slideIn .3s ease; }
.flash-success { background: var(--primary); }
.flash-error { background: var(--danger); }
.flash button { background: none; color: #fff; font-size: 1.2rem; cursor: pointer; opacity: .8; }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Hero */
.hero { background: linear-gradient(135deg, #e8f5ee, #f0fdf4 50%, #fefce8); padding: 50px 0; }
.hero-content { display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; align-items: center; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.3; margin-bottom: 14px; }
.hero h1 span { color: var(--primary); }
.hero p { color: var(--text-muted); margin-bottom: 24px; max-width: 460px; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-card { background: #fff; border-radius: 16px; padding: 36px 28px; text-align: center; box-shadow: var(--shadow-hover); }
.hero-card i { font-size: 2.8rem; color: var(--primary); margin-bottom: 12px; }

/* Features */
.features { padding: 36px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-item { text-align: center; padding: 20px 12px; border-radius: var(--radius); }
.feature-item:hover { background: var(--primary-light); }
.feature-item i { font-size: 1.8rem; color: var(--primary); margin-bottom: 10px; }
.feature-item h4 { font-size: 1rem; margin-bottom: 4px; }
.feature-item p { font-size: .85rem; color: var(--text-muted); }

/* Section */
.section { padding: 44px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.section-header h2 { font-size: 1.5rem; font-weight: 700; }
.view-all { color: var(--primary); font-weight: 600; }

/* Categories */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; }
.category-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 12px; text-align: center; transition: .25s; }
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-3px); }
.category-card .icon { width: 52px; height: 52px; margin: 0 auto 10px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--primary); }
.category-card h4 { font-size: .9rem; }

/* Products */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .25s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.product-img { height: 140px; background: var(--bg-light); display: flex; align-items: center; justify-content: center; position: relative; font-size: 3rem; }
.product-badge { position: absolute; top: 8px; left: 8px; background: var(--secondary); color: #fff; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.product-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-cat { font-size: .72rem; color: var(--primary); font-weight: 600; margin-bottom: 3px; }
.product-name { font-size: .95rem; font-weight: 600; margin-bottom: 6px; }
.product-unit { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; }
.product-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.product-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.product-price .old { font-size: .8rem; color: var(--text-muted); text-decoration: line-through; font-weight: 400; margin-left: 5px; }
.add-cart-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .25s; }
.add-cart-btn:hover { background: var(--primary-dark); transform: scale(1.08); }

/* Page header */
.page-header { background: linear-gradient(135deg, #e8f5ee, #f0fdf4); padding: 32px 0; text-align: center; }
.page-header h1 { font-size: 1.6rem; margin-bottom: 4px; }
.page-header p { color: var(--text-muted); }

/* Auth forms */
.auth-section { padding: 50px 0; min-height: 60vh; display: flex; align-items: center; }
.auth-box { max-width: 420px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.auth-box h1 { text-align: center; font-size: 1.5rem; margin-bottom: 6px; }
.auth-box .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 24px; font-size: .95rem; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 5px; font-size: .9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; transition: .25s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,138,78,.15);
}
.auth-footer { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; padding: 36px 0; }
.cart-item { display: flex; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; align-items: center; }
.cart-item-img { width: 70px; height: 70px; background: var(--bg-light); border-radius: 10px; 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: .95rem; margin-bottom: 2px; }
.cart-item-info .unit { font-size: .8rem; color: var(--text-muted); }
.cart-item-price { font-weight: 700; color: var(--primary); margin-top: 4px; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-control button { width: 30px; height: 30px; background: var(--bg-light); cursor: pointer; font-weight: 600; }
.qty-control span { width: 32px; text-align: center; font-weight: 600; }
.remove-btn { background: none; color: var(--danger); cursor: pointer; padding: 6px; font-size: 1rem; }
.cart-summary { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; height: fit-content; position: sticky; top: 130px; }
.cart-summary h3 { margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: .95rem; }
.summary-row.total { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 3.5rem; color: var(--border); margin-bottom: 16px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; }

/* Dashboard */
.dashboard { padding: 36px 0; }
.dash-grid { display: grid; grid-template-columns: 240px 1fr; gap: 28px; }
.dash-sidebar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; height: fit-content; }
.dash-sidebar h3 { font-size: 1rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.dash-sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; margin-bottom: 4px; font-weight: 500; color: var(--text-muted); }
.dash-sidebar a:hover, .dash-sidebar a.active { background: var(--primary-light); color: var(--primary); }
.dash-content { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.dash-content h2 { font-size: 1.3rem; margin-bottom: 20px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--primary-light); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-card h3 { font-size: 1.6rem; color: var(--primary); }
.stat-card p { font-size: .85rem; color: var(--text-muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-light); font-weight: 600; font-size: .85rem; color: var(--text-muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-admin { background: #fef3c7; color: #92400e; }
.badge-customer { background: #e0e7ff; color: #3730a3; }

/* Admin */
.admin-body { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: #1a2e22; color: #fff; padding: 20px 0; flex-shrink: 0; }
.admin-sidebar .logo { padding: 0 20px 20px; font-size: 1.15rem; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px; }
.admin-sidebar .logo i { color: #4ade80; }
.admin-sidebar a { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: rgba(255,255,255,.75); font-weight: 500; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.1); color: #fff; }
.admin-main { flex: 1; background: #f3f4f6; }
.admin-topbar { background: #fff; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.admin-content { padding: 24px; }
.admin-content h1 { font-size: 1.4rem; margin-bottom: 20px; }
.admin-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; margin-bottom: 20px; }

/* Footer */
.footer { background: #1a2e22; color: rgba(255,255,255,.85); padding: 40px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 28px; margin-bottom: 30px; }
.footer .logo { color: #fff; margin-bottom: 12px; }
.footer .logo i { color: #4ade80; }
.footer-col p { font-size: .9rem; opacity: .8; margin-bottom: 12px; }
.footer-col h4 { color: #fff; margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 7px; }
.footer-col a:hover { color: #4ade80; }
.contact-info li { display: flex; gap: 8px; margin-bottom: 8px; font-size: .9rem; }
.contact-info i { color: #4ade80; margin-top: 3px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 0; text-align: center; font-size: .85rem; opacity: .7; }

/* Products page layout */
.products-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 36px 0; }
.filters { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; height: fit-content; position: sticky; top: 130px; }
.filters h3 { margin-bottom: 16px; }
.filter-group { margin-bottom: 18px; }
.filter-group h4 { font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; }
.filter-group a, .filter-group label { display: block; padding: 6px 0; cursor: pointer; font-size: .92rem; }
.filter-group a:hover, .filter-group a.active { color: var(--primary); font-weight: 600; }

/* Responsive */
@media (max-width: 992px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin: 0 auto 24px; }
  .hero-btns { justify-content: center; }
  .hero-card { display: none; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-layout, .dash-grid, .products-layout { grid-template-columns: 1fr; }
  .filters, .cart-summary, .dash-sidebar { position: static; }
  .admin-body { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .nav { display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
  .search-box { display: none; }
  .hide-sm { display: none; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .footer-grid { grid-template-columns: 1fr; }
}
