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

:root {
  --green-950: #052e16;
  --green-900: #14532d;
  --green-800: #166534;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-400: #4ade80;
  --green-200: #bbf7d0;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;
  --cream:     #fefcf3;
  --warm-gray: #f5f5f0;
  --charcoal:  #1c1c1e;
  --text-main: #1a2e1a;
  --text-muted:#5a7a5a;
  --white:     #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
  --radius:    16px;
  --radius-sm: 10px;
  --font: 'Plus Jakarta Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text-main);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ─────────────────────────────────── */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--green-100);
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar-brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.navbar-brand img { width: 40px; height: 40px; object-fit: contain; }
.navbar-brand-text { display: flex; flex-direction: column; }
.navbar-brand-text strong { font-size: 1.15rem; font-weight: 800; color: var(--green-800); letter-spacing: -.3px; }
.navbar-brand-text span { font-size: .7rem; color: var(--text-muted); font-weight: 500; }
.navbar-actions { display: flex; align-items: center; gap: .75rem; }
.navbar-icon { background: var(--green-50); border: none; border-radius: 10px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--green-700); transition: background .2s; }
.navbar-icon:hover { background: var(--green-100); }

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s ease;
  border: 2px solid transparent;
  text-decoration: none;
  letter-spacing: .01em;
}
.btn-primary {
  background: var(--green-700);
  color: var(--white);
  border-color: var(--green-700);
}
.btn-primary:hover { background: var(--green-800); border-color: var(--green-800); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(22,101,52,.3); }
.btn-outline {
  background: transparent;
  color: var(--green-700);
  border-color: var(--green-700);
}
.btn-outline:hover { background: var(--green-50); }
.btn-full { width: 100%; }
.btn-lg { padding: .95rem 2rem; font-size: 1rem; border-radius: 12px; }

/* ── Forms ─────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-main); margin-bottom: .45rem; }
.form-control {
  width: 100%;
  padding: .8rem 1rem .8rem 2.75rem;
  border: 1.5px solid var(--green-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .9rem;
  color: var(--text-main);
  background: var(--green-50);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
  background: var(--white);
}
.form-control.is-invalid { border-color: #dc2626; }
.form-control.is-valid { border-color: var(--green-500); }
.input-wrapper { position: relative; }
.input-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}
.eye-toggle {
  position: absolute;
  right: .85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  display: flex;
  align-items: center;
}
.eye-toggle:hover { color: var(--green-700); }
.error-msg { font-size: .78rem; color: #dc2626; margin-top: .35rem; display: flex; align-items: center; gap: .3rem; }
.invalid-feedback { color: #dc2626; font-size: .78rem; margin-top: .3rem; }

/* ── Auth Layout ─────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-left {
  background: linear-gradient(145deg, var(--green-900) 0%, var(--green-700) 60%, var(--green-500) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-left-content { position: relative; z-index: 1; text-align: center; color: white; }
.auth-left-logo { width: 300px; height: 300px; object-fit: contain; margin-bottom: 1.5rem; filter: drop-shadow(0 8px 24px rgba(0,0,0,.3)); }
.auth-left h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: .75rem; line-height: 1.2; }
.auth-left p { font-size: 1rem; opacity: .85; line-height: 1.6; max-width: 340px; }
.auth-left-features { margin-top: 2.5rem; display: flex; flex-direction: column; gap: .75rem; text-align: left; }
.auth-feature { display: flex; align-items: center; gap: .75rem; background: rgba(255,255,255,.1); border-radius: 10px; padding: .75rem 1rem; backdrop-filter: blur(4px); }
.auth-feature-icon { width: 36px; height: 36px; background: rgba(255,255,255,.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-feature span { font-size: .88rem; font-weight: 500; }

.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: var(--cream);
}
.auth-card {
  width: 100%;
  max-width: 440px;
}
.auth-card-header { margin-bottom: 2rem; }
.auth-card-header h2 { font-size: 1.75rem; font-weight: 800; color: var(--text-main); margin-bottom: .35rem; }
.auth-card-header p { color: var(--text-muted); font-size: .9rem; }
.auth-card-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--text-muted); }
.auth-card-footer a { color: var(--green-700); font-weight: 600; text-decoration: none; }
.auth-card-footer a:hover { text-decoration: underline; }

/* ── Password Strength ─────────────────────────── */
.strength-bar { margin-top: .5rem; }
.strength-tracks { display: flex; gap: 4px; margin-bottom: .35rem; }
.strength-track { flex: 1; height: 4px; border-radius: 2px; background: var(--green-100); transition: background .3s; }
.strength-track.weak { background: #ef4444; }
.strength-track.fair { background: #f59e0b; }
.strength-track.good { background: #22c55e; }
.strength-track.strong { background: #16a34a; }
.strength-label { font-size: .75rem; font-weight: 600; }
.strength-rules { margin-top: .75rem; display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.strength-rule { font-size: .75rem; display: flex; align-items: center; gap: .4rem; color: var(--text-muted); }
.strength-rule.met { color: var(--green-700); }
.strength-rule svg { width: 13px; height: 13px; }

/* ── Admin Key ─────────────────────────────── */
.admin-key-notice { 
  background: linear-gradient(135deg, #fef3c7, #fde68a); 
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .82rem;
  color: #92400e;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── Select ─────────────────────────────── */
select.form-control { padding-left: 2.75rem; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a7a5a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; }

/* ── Alerts ─────────────────────────────── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: var(--green-50); border: 1px solid var(--green-200); color: var(--green-800); }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Hero ─────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--green-50) 0%, var(--cream) 60%);
  padding: 3.5rem 2rem 2.5rem;
  border-radius: 0 0 2rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(74,222,128,.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag { font-size: .75rem; font-weight: 700; letter-spacing: .1em; color: var(--green-600); text-transform: uppercase; margin-bottom: .75rem; }
.hero h1 { font-size: 2.5rem; font-weight: 800; color: var(--text-main); line-height: 1.15; margin-bottom: .75rem; max-width: 560px; }
.hero p { color: var(--text-muted); font-size: 1rem; max-width: 500px; line-height: 1.65; }

/* ── Product Cards ─────────────────────────────── */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; padding: 0 .25rem; }
.section-title { font-size: 1.15rem; font-weight: 700; color: var(--text-main); }
.section-badge { background: var(--green-100); color: var(--green-800); font-size: .78rem; font-weight: 700; padding: .3rem .75rem; border-radius: 20px; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
  border: 1px solid var(--green-100);
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-img { width: 100%; height: 150px; object-fit: cover; display: block; }
.product-body { padding: 1rem; }
.product-name { font-weight: 700; font-size: .95rem; margin-bottom: .2rem; }
.product-sold { font-size: .78rem; color: var(--text-muted); margin-bottom: .5rem; }
.product-price { font-size: 1rem; font-weight: 800; color: var(--green-700); }

/* ── Day Tabs ─────────────────────────────── */
.day-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.25rem 0; }
.day-tab {
  padding: .45rem 1.15rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: var(--white);
  color: var(--text-muted);
  transition: all .15s;
}
.day-tab:first-child { display: flex; align-items: center; gap: .35rem; }
.day-tab.active { background: var(--green-700); color: white; border-color: var(--green-700); }
.day-tab:not(.active):hover { border-color: var(--green-300); color: var(--green-700); }

/* ── Search ─────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1.5px solid var(--green-200);
  border-radius: 50px;
  padding: .6rem 1.25rem;
  gap: .75rem;
  margin-bottom: 1.5rem;
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(22,163,74,.1); }
.search-bar input { border: none; outline: none; font-family: var(--font); font-size: .9rem; color: var(--text-main); flex: 1; background: transparent; }
.search-bar svg { color: var(--text-muted); flex-shrink: 0; }

/* ── Admin Dashboard ─────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: var(--white);
  border-right: 1px solid var(--green-100);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem 1.5rem; border-bottom: 1px solid var(--green-100); margin-bottom: 1rem; }
.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; }
.sidebar-brand-text strong { display: block; font-size: 1rem; font-weight: 800; color: var(--green-800); }
.sidebar-brand-text span { font-size: .72rem; color: var(--text-muted); }
.sidebar-label { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); padding: 0 1.5rem; margin: 1rem 0 .5rem; }
.sidebar-nav { list-style: none; padding: 0 .75rem; }
.sidebar-nav li a, .sidebar-nav li button {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: all .15s;
}
.sidebar-nav li a:hover, .sidebar-nav li button:hover { background: var(--green-50); color: var(--green-800); }
.sidebar-nav li a.active { background: var(--green-100); color: var(--green-800); font-weight: 700; }
.sidebar-nav li.logout button { color: #dc2626; }
.sidebar-nav li.logout button:hover { background: #fef2f2; color: #dc2626; }

.main-content { margin-left: 260px; flex: 1; padding: 2rem; background: var(--warm-gray); min-height: 100vh; }
.page-header { background: linear-gradient(135deg, var(--green-800), var(--green-600)); border-radius: var(--radius); padding: 2rem; color: white; margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: flex-start; }
.page-header-left small { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.page-header-left h1 { font-size: 2rem; font-weight: 800; margin: .3rem 0 .5rem; }
.page-header-left p { opacity: .85; font-size: .9rem; }
.page-header-right { text-align: right; }
.page-date { font-size: .85rem; background: rgba(255,255,255,.15); padding: .5rem 1rem; border-radius: 8px; backdrop-filter: blur(4px); margin-bottom: .5rem; }
.btn-white { background: white; color: var(--green-800); border: none; padding: .6rem 1.2rem; border-radius: 8px; font-family: var(--font); font-weight: 700; font-size: .85rem; cursor: pointer; transition: transform .2s; }
.btn-white:hover { transform: translateY(-1px); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--green-100); }
.stat-card.highlight { background: linear-gradient(135deg, var(--green-800), var(--green-600)); color: white; }
.stat-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.stat-label { font-size: .8rem; font-weight: 600; opacity: .8; }
.stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.stat-card.highlight .stat-icon { background: rgba(255,255,255,.2); color: white; }
.stat-card:not(.highlight) .stat-icon { background: var(--green-100); color: var(--green-700); }
.stat-value { font-size: 2.25rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .25rem; }
.stat-sub { font-size: .78rem; opacity: .75; }

.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.mini-stat { background: var(--white); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); border: 1px solid var(--green-100); }
.mini-stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; margin-top: .35rem; }
.mini-stat-value { font-size: 1.75rem; font-weight: 800; }

.chart-card { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--green-100); }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.chart-title { font-size: 1.05rem; font-weight: 700; }
.chart-badge { font-size: .75rem; color: var(--text-muted); }
.chart-area { height: 200px; position: relative; }

/* ── Divider ─────────────────────────────── */
.divider { display: flex; align-items: center; gap: 1rem; color: var(--text-muted); font-size: .8rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--green-200); }

/* ── Table ─────────────────────────────── */
.table-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; border: 1px solid var(--green-100); }
.table-card table { width: 100%; border-collapse: collapse; }
.table-card th { background: var(--green-50); padding: .85rem 1.25rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); text-align: left; }
.table-card td { padding: 1rem 1.25rem; border-top: 1px solid var(--green-50); font-size: .88rem; }
.badge { display: inline-flex; align-items: center; padding: .25rem .65rem; border-radius: 20px; font-size: .73rem; font-weight: 700; }
.badge-pending { background: #fff7ed; color: #c2410c; }
.badge-delivered { background: var(--green-100); color: var(--green-800); }
.badge-processing { background: #eff6ff; color: #1d4ed8; }

/* ── Cart Modal ─────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--white); border-radius: var(--radius); max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: translateY(20px); transition: transform .25s; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--green-100); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-weight: 700; font-size: 1.05rem; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.4rem; line-height: 1; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--green-100); display: flex; gap: .75rem; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; }
}
@media (max-width: 640px) {
  .admin-layout { flex-direction: column; }
  .sidebar { position: relative; width: 100%; height: auto; }
  .main-content { margin-left: 0; }
  .hero h1 { font-size: 1.75rem; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}
