/* ================================================================
   CHAITANYA SHRI DAIRY FARM – ADMIN + LOGIN CSS
   ================================================================ */

/* ===== CSS VARIABLES (inherited from main) ===== */
:root {
  --green-dark:   #1a4a0a;
  --green-main:   #2d7a1a;
  --green-light:  #4caf50;
  --green-pale:   #e8f5e9;
  --gold:         #d4a017;
  --gold-light:   #f0c842;
  --cream:        #fffbf0;
  --cream-dark:   #f5ede0;
  --white:        #ffffff;
  --text-dark:    #1a1a1a;
  --text-mid:     #4a4a4a;
  --text-light:   #7a7a7a;
  --shadow-sm:    0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.12);
  --shadow-lg:    0 20px 60px rgba(0,0,0,0.18);
  --radius-sm:    8px;
  --radius-md:    16px;
  --radius-lg:    24px;
  --transition:   all 0.3s cubic-bezier(0.4,0,0.2,1);
  --font-hindi:   'Tiro Devanagari Hindi', serif;
  --font-main:    'Poppins', sans-serif;
  --sidebar-w:    260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); background: #f0f4f8; color: var(--text-dark); }
.hindi-text { font-family: var(--font-hindi); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-main) 50%, #1a6610 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(212,160,23,0.15), transparent 70%);
  border-radius: 50%;
}
.login-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 50px 44px;
  max-width: 460px; width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 2;
  animation: fadeInUp 0.6s ease;
}
.login-header { text-align: center; margin-bottom: 36px; }
.login-logo { font-size: 3rem; margin-bottom: 8px; }
.login-header h1 {
  font-size: 1.5rem; font-weight: 800;
  color: var(--green-dark);
  font-family: var(--font-hindi);
  margin-bottom: 4px;
}
.login-header p { color: var(--text-light); font-size: 0.88rem; }
.login-tabs {
  display: flex; gap: 0;
  background: var(--green-pale);
  border-radius: 50px;
  padding: 4px;
  margin-bottom: 28px;
}
.login-tab {
  flex: 1;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600; font-size: 0.9rem;
  cursor: pointer; border: none;
  background: none;
  color: var(--text-mid);
  transition: var(--transition);
}
.login-tab.active {
  background: var(--white);
  color: var(--green-dark);
  box-shadow: var(--shadow-sm);
}
.login-form-section { display: none; }
.login-form-section.active { display: block; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600; font-size: 0.88rem;
  color: var(--green-dark);
  margin-bottom: 7px;
}
.form-group label i { margin-right: 6px; color: var(--green-main); }
.form-group input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid rgba(45,122,26,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  font-family: var(--font-main);
}
.form-group input:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(45,122,26,0.12);
}
.form-group .input-help {
  font-size: 0.78rem; color: var(--text-light);
  margin-top: 5px;
}
.btn-login-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--green-main), var(--green-light));
  color: var(--white);
  padding: 14px;
  border-radius: 50px;
  font-weight: 700; font-size: 1rem;
  border: none; cursor: pointer;
  box-shadow: 0 4px 20px rgba(45,122,26,0.35);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login-submit:hover {
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  transform: translateY(-2px);
}
.login-divider {
  text-align: center;
  color: var(--text-light);
  font-size: 0.82rem;
  margin: 16px 0;
  position: relative;
}
.login-divider::before, .login-divider::after {
  content: '';
  position: absolute; top: 50%;
  width: 42%; height: 1px;
  background: rgba(0,0,0,0.1);
}
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }
.btn-whatsapp-login {
  width: 100%;
  background: #25d366;
  color: var(--white);
  padding: 13px;
  border-radius: 50px;
  font-weight: 700; font-size: 0.95rem;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition);
}
.btn-whatsapp-login:hover { background: #128c7e; }
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.82rem;
  color: var(--text-light);
}
.login-footer a { color: var(--green-main); font-weight: 600; }
.back-home {
  position: absolute; top: 20px; left: 20px;
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem; font-weight: 600;
  transition: var(--transition);
}
.back-home:hover { color: var(--white); }
.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 14px;
  display: none;
}
.error-msg.show { display: block; }
.success-msg {
  background: var(--green-pale);
  border: 1px solid var(--green-light);
  color: var(--green-dark);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 14px;
  display: none;
}
.success-msg.show { display: block; }

/* ================================================================
   ADMIN DASHBOARD
   ================================================================ */
.admin-layout {
  display: flex; min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--green-dark);
  color: var(--white);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: var(--transition);
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.sidebar-logo span { font-size: 1.8rem; }
.sidebar-logo h2 {
  font-family: var(--font-hindi);
  font-size: 1rem; font-weight: 800;
  color: var(--white); line-height: 1.1;
}
.sidebar-role {
  font-size: 0.72rem; color: var(--gold-light);
  font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase;
}
.sidebar-nav { padding: 16px 0; flex: 1; }
.nav-section { margin-bottom: 8px; }
.nav-section-title {
  padding: 8px 20px;
  font-size: 0.68rem; font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  font-size: 0.88rem; font-weight: 500;
  color: rgba(255,255,255,0.7);
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border-left-color: var(--gold);
}
.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border-left-color: var(--gold);
  font-weight: 600;
}
.nav-item i { width: 18px; text-align: center; font-size: 0.95rem; }
.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.admin-user-info {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.admin-avatar {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.admin-name { font-size: 0.85rem; font-weight: 600; color: var(--white); }
.admin-email { font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.btn-logout {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; width: 100%;
  transition: var(--transition);
}
.btn-logout:hover { background: rgba(220,38,38,0.2); color: #fca5a5; }

/* MAIN CONTENT */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
}
.admin-topbar {
  background: var(--white);
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.hamburger-admin {
  display: none;
  background: none; border: none;
  font-size: 1.3rem; cursor: pointer;
  color: var(--text-mid);
}
.page-title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-dark);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-icon-btn {
  position: relative;
  background: none; border: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-mid);
  font-size: 1rem;
  transition: var(--transition);
}
.topbar-icon-btn:hover { background: var(--green-pale); color: var(--green-main); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: #ef4444; border-radius: 50%;
  border: 2px solid var(--white);
}
.topbar-date { font-size: 0.82rem; color: var(--text-light); }

/* ADMIN CONTENT AREA */
.admin-content {
  padding: 32px;
  flex: 1;
  overflow-y: auto;
}
.admin-section { display: none; }
.admin-section.active { display: block; }

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
  border: 1px solid rgba(0,0,0,0.04);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
}
.stat-card.green::before { background: var(--green-main); }
.stat-card.gold::before { background: var(--gold); }
.stat-card.blue::before { background: #3b82f6; }
.stat-card.red::before { background: #ef4444; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-card.green .stat-icon { background: var(--green-pale); color: var(--green-main); }
.stat-card.gold .stat-icon { background: #fef3c7; color: var(--gold); }
.stat-card.blue .stat-icon { background: #eff6ff; color: #3b82f6; }
.stat-card.red .stat-icon { background: #fef2f2; color: #ef4444; }
.stat-info .label {
  font-size: 0.78rem; color: var(--text-light);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 4px;
}
.stat-info .value {
  font-size: 1.8rem; font-weight: 800;
  color: var(--text-dark); line-height: 1.1;
}
.stat-info .change {
  font-size: 0.75rem; font-weight: 600;
  margin-top: 2px;
}
.change.up { color: var(--green-main); }
.change.down { color: #ef4444; }

/* DATA TABLE */
.table-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 24px;
}
.table-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.table-header h3 { font-size: 1rem; font-weight: 700; color: var(--text-dark); }
.table-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tbl-search {
  padding: 8px 14px;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  font-size: 0.85rem; outline: none;
  transition: var(--transition);
}
.tbl-search:focus { border-color: var(--green-main); }
.tbl-filter {
  padding: 8px 14px;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  font-size: 0.85rem; outline: none;
  cursor: pointer;
}
.btn-icon {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--transition);
}
.btn-icon.green { background: var(--green-pale); color: var(--green-main); }
.btn-icon.green:hover { background: var(--green-main); color: var(--white); }
.btn-icon.gold { background: #fef3c7; color: var(--gold); }
.btn-icon.gold:hover { background: var(--gold); color: var(--white); }
.btn-icon.red { background: #fef2f2; color: #ef4444; }
.btn-icon.red:hover { background: #ef4444; color: var(--white); }
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
thead { background: #f8fafc; }
th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700; font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--text-mid);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-badge.pending    { background: #fef3c7; color: #92400e; }
.status-badge.confirmed  { background: var(--green-pale); color: var(--green-dark); }
.status-badge.delivered  { background: #e0e7ff; color: #3730a3; }
.status-badge.cancelled  { background: #fef2f2; color: #b91c1c; }
.status-badge.active     { background: var(--green-pale); color: var(--green-dark); }
.status-badge.inactive   { background: #f1f5f9; color: #64748b; }
.action-btns { display: flex; gap: 6px; }
.action-btn {
  width: 30px; height: 30px;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.action-btn.view  { background: #eff6ff; color: #3b82f6; }
.action-btn.edit  { background: var(--green-pale); color: var(--green-main); }
.action-btn.del   { background: #fef2f2; color: #ef4444; }
.action-btn:hover { opacity: 0.75; transform: scale(1.1); }

/* CHART AREA */
.charts-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}
.chart-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 20px; color: var(--text-dark); }

/* QUICK ACTION BUTTONS */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.quick-action {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.06);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.quick-action:hover {
  background: var(--green-pale);
  border-color: var(--green-light);
  transform: translateY(-3px);
}
.quick-action i {
  font-size: 1.5rem;
  color: var(--green-main);
  margin-bottom: 8px;
  display: block;
}
.quick-action span { font-size: 0.8rem; font-weight: 600; color: var(--text-dark); }

/* PRODUCT FORM */
.product-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  border: 1px solid rgba(0,0,0,0.04);
}
.form-card h3 {
  font-size: 1rem; font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.form-card .form-group { margin-bottom: 16px; }
.form-card label {
  display: block;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
}
.form-card input,
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-sm);
  font-size: 0.9rem; outline: none;
  transition: var(--transition);
  background: var(--white);
  font-family: var(--font-main);
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(45,122,26,0.1);
}
.btn-save {
  background: linear-gradient(135deg, var(--green-main), var(--green-light));
  color: var(--white);
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700; font-size: 0.9rem;
  border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(45,122,26,0.3);
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-save:hover {
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  transform: translateY(-2px);
}

/* ORDER DETAIL MODAL */
.order-detail-modal {
  max-width: 560px;
}
.detail-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.88rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-light); font-weight: 600; }
.detail-value { color: var(--text-dark); font-weight: 600; text-align: right; }

/* SUBSCRIPTION TABLE EXTRAS */
.sub-plan-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.72rem; font-weight: 700;
  background: var(--green-pale);
  color: var(--green-dark);
}
.sub-plan-chip.ghee { background: #fef3c7; color: #92400e; }
.sub-plan-chip.combo { background: #f3e8ff; color: #6b21a8; }

/* TOAST (Admin) */
.admin-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--green-dark);
  color: var(--white);
  padding: 14px 24px;
  border-radius: 50px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 0.88rem;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: all 0.4s ease;
}
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast.error { background: #dc2626; }
.admin-toast.warn  { background: var(--gold); }

/* ANIMATIONS */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
  .product-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .admin-sidebar {
    left: calc(-1 * var(--sidebar-w));
  }
  .admin-sidebar.open { left: 0; }
  .admin-main { margin-left: 0; }
  .hamburger-admin { display: flex; }
  .admin-content { padding: 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-topbar { padding: 12px 16px; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .login-container { padding: 32px 24px; }
}
