/* =============================================
   AgriConnect – Custom CSS
   Primary: #1D9E75  Dark: #0F6E56
   ============================================= */

:root {
  --primary:    #1D9E75;
  --primary-dk: #0F6E56;
  --primary-lt: #e8f7f2;
  --bs-font-sans-serif: 'Segoe UI', Arial, sans-serif;
}

/* ---- Typography ---- */
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f5f7fa; }

/* ---- Primary Custom Color ---- */
.bg-primary-custom    { background-color: var(--primary) !important; }
.bg-dark-custom       { background-color: var(--primary-dk) !important; }
.text-primary-custom  { color: var(--primary) !important; }
.btn-primary-custom {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary-custom:hover,
.btn-primary-custom:focus {
  background-color: var(--primary-dk);
  border-color: var(--primary-dk);
  color: #fff;
}
.btn-primary-custom:active { background-color: #0a5240; }

/* ---- Navbar ---- */
.navbar.bg-primary-custom { background-color: var(--primary) !important; }

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-container {
  width: 100%;
  max-width: 440px;
  padding: 1rem;
}
.login-card { border-radius: 16px; }
.login-logo {
  width: 64px; height: 64px;
  background: var(--primary-lt);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}

/* ---- Sidebar Layout ---- */
.sidebar-layout { background: #f0f2f5; }
.wrapper { min-height: 100vh; }
.sidebar {
  width: 240px;
  min-width: 240px;
  background: linear-gradient(180deg, var(--primary-dk) 0%, #0a5240 100%);
  color: #fff;
  min-height: 100vh;
  transition: width 0.3s ease;
}
.sidebar.collapsed { width: 60px; min-width: 60px; }
.sidebar-brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.sidebar-divider { border-color: rgba(255,255,255,0.15); margin: 0.25rem 0; }
.sidebar .nav-link {
  color: rgba(255,255,255,0.8);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 2px;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,255,255,0.2); color: #fff; font-weight: 600; }
.main-content { min-height: 100vh; overflow-x: hidden; }
.content-area { min-height: calc(100vh - 56px); }

/* ---- Stat Cards ---- */
.stat-card { border-radius: 12px; transition: transform 0.2s, box-shadow 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto;
}
.bg-primary-light  { background-color: #dbeafe; }
.bg-success-light  { background-color: #dcfce7; }
.bg-warning-light  { background-color: #fef9c3; }
.bg-info-light     { background-color: #cffafe; }
.bg-danger-light   { background-color: #fee2e2; }

/* ---- Product Cards ---- */
.product-card { border-radius: 12px; transition: transform 0.2s, box-shadow 0.2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important; }
.price-display { font-size: 1.15rem; }

/* ---- Tables ---- */
.table thead th { font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.4px; }
.table-success-subtle { background-color: #f0fdf4; }

/* ---- Cards ---- */
.card { border-radius: 12px; }
.card-header { border-radius: 12px 12px 0 0 !important; font-size: 0.9rem; }

/* ---- Badges ---- */
.badge { font-size: 0.72rem; }

/* ---- Flash Messages ---- */
.alert { border-radius: 8px; }
.alert-sm { font-size: 0.88rem; padding: 0.5rem 0.75rem; }

/* ---- Progress ---- */
.progress { border-radius: 50px; background: #e5e7eb; }
.progress-bar.bg-primary-custom { background-color: var(--primary) !important; }

/* ---- Footer ---- */
.footer { font-size: 0.85rem; }

/* ---- Forms ---- */
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(29,158,117,0.2);
}
.input-group-text { background: #f8f9fa; }

/* ---- Pagination ---- */
.page-link { color: var(--primary); }
.page-item.active .page-link { background-color: var(--primary); border-color: var(--primary); }

/* ---- Modal ---- */
.modal-content { border-radius: 16px; border: none; }
.modal-header { border-radius: 16px 16px 0 0; }

/* ---- WhatsApp Button ---- */
.btn-outline-success:hover .bi-whatsapp { color: #fff; }

/* ---- Overdue Highlight ---- */
tr.table-danger td { color: #721c24; }

/* ---- Responsive Sidebar ---- */
@media (max-width: 768px) {
  .sidebar { width: 0; min-width: 0; position: fixed; z-index: 1040; overflow: hidden; }
  .sidebar.show { width: 240px; min-width: 240px; }
  .main-content { width: 100%; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
