/* ==========================================================================
   MaziwaPlus Portal — design tokens
   Palette: pasture green + milk cream + sky blue accent (rural-dairy,
   not corporate-blue). Built mobile-first for farmers on basic phones
   and collectors standing at a milk can in the yard.
   ========================================================================== */
:root {
  --mp-green-900: #1c3d2e;
  --mp-green-700: #2f6b4f;
  --mp-green-500: #3f8f68;
  --mp-green-100: #e6f2ea;
  --mp-cream: #fbf8f1;
  --mp-cream-dark: #f1ead9;
  --mp-blue: #2f7cad;
  --mp-blue-light: #eaf4fb;
  --mp-amber: #c9822b;
  --mp-amber-light: #fbf0de;
  --mp-red: #b1493a;
  --mp-red-light: #fbeae7;
  --mp-ink: #26302b;
  --mp-ink-soft: #5b665f;
  --mp-ink-faint: #8b9089;
  --mp-border: #e1dccb;
  /* Radius scale, soft-SaaS style: cards get the roundest treatment,
     buttons/inputs a step down, badges/pills fully round. Mirrors a
     rounded-3xl/2xl/full hierarchy rather than one flat radius everywhere. */
  --mp-radius: 20px;
  --mp-radius-sm: 12px;
  --mp-radius-pill: 999px;
  /* Layered, low-contrast shadow instead of one heavy drop shadow -
     reads as "soft SaaS" rather than "skeuomorphic card". */
  --mp-shadow: 0 1px 2px rgba(28, 61, 46, 0.04), 0 4px 14px rgba(28, 61, 46, 0.07);
  --mp-shadow-sm: 0 1px 2px rgba(28, 61, 46, 0.05);
  --mp-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mp-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--mp-font-body);
  background: var(--mp-cream);
  color: var(--mp-ink);
  min-height: 100vh;
}

h1, h2, h3, .mp-display {
  font-family: var(--mp-font-display);
  color: var(--mp-green-900);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--mp-green-700); }
a:hover { color: var(--mp-green-900); }

/* ---------- Layout shell: left sidebar + main column ---------- */
.mp-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}
.mp-main-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* Main content grows to fill available height so the footer sits pinned
   at the bottom of the viewport on short pages, and simply follows
   content down (not fixed) once a page is taller than the screen. */
.mp-main-col > main {
  flex: 1 0 auto;
}

/* ---------- Sidebar ---------- */
.mp-sidebar {
  --bs-offcanvas-width: 270px;
  width: 264px;
  flex: 0 0 264px;
  background: linear-gradient(165deg, var(--mp-green-900) 0%, #13291e 65%, #0f2118 100%);
  color: var(--mp-cream);
  border: none;
}
/* Pin the sidebar to the viewport on desktop so it stops scrolling away
   with a tall page - only its own nav list (below) scrolls internally
   once the group list outgrows the screen. */
@media (min-width: 992px) {
  .mp-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
  }
}
.mp-sidebar-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1rem 1rem;
}
.mp-sidebar-brand, .mp-mobile-brand {
  font-family: var(--mp-font-display);
  color: var(--mp-cream) !important;
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.mp-sidebar .mp-drop, .mp-mobile-bar .mp-drop {
  width: 12px; height: 16px;
  background: linear-gradient(160deg, var(--mp-amber) 0%, var(--mp-cream) 100%);
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  display: inline-block;
  flex: none;
}
.mp-sidebar-nav {
  margin-top: 1.5rem;
  flex: 1 1 auto;
  overflow-y: auto;
}
.mp-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.mp-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--mp-radius-sm);
  color: rgba(251, 248, 241, 0.82);
  font-weight: 500;
  font-size: 0.94rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mp-nav-link:hover {
  background: rgba(251, 248, 241, 0.08);
  color: #fff;
}
.mp-nav-link.active {
  background: linear-gradient(90deg, rgba(201,130,43,0.22) 0%, rgba(251,248,241,0.06) 100%);
  color: #fff;
  border-left-color: var(--mp-amber);
  font-weight: 600;
}
.mp-nav-link.mp-nav-sub {
  padding-left: 1.1rem;
  font-size: 0.88rem;
}
.mp-nav-group-label {
  margin: 0.9rem 0 0.15rem;
  padding: 0 0.75rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: rgba(251, 248, 241, 0.45);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mp-sidebar .badge-notif {
  background: var(--mp-amber);
  font-size: 0.65rem;
}
.mp-sidebar .nav-group-badge {
  background: var(--mp-amber);
  font-size: 0.62rem;
}

/* ---------- Sidebar accordion groups ---------- */
/* Each group label is now a toggle button (Bootstrap collapse) rather
   than static text, so 8+ groups don't all render open at once. */
.mp-nav-group { margin: 0; }
.mp-nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0.9rem 0 0.15rem;
  padding: 0.3rem 0.75rem;
  background: none;
  border: none;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: rgba(251, 248, 241, 0.55);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.mp-nav-group-toggle:hover {
  color: #fff;
  background: rgba(251, 248, 241, 0.06);
}
.mp-nav-group-toggle-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mp-chevron {
  transition: transform 0.18s ease;
  flex: none;
}
.mp-nav-group-toggle[aria-expanded="true"] .mp-chevron {
  transform: rotate(90deg);
}
.mp-nav-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* ---------- Unified "needs your attention" indicator ---------- */
/* Replaces separately-rendered $unreadCount / $pendingAdvCount badges
   scattered across the sidebar with one combined signal up top. */
.mp-attention-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--mp-radius-sm);
  background: rgba(201, 130, 43, 0.18);
  border: 1px solid rgba(201, 130, 43, 0.4);
  color: var(--mp-cream);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.mp-attention-pill:hover {
  background: rgba(201, 130, 43, 0.3);
  border-color: var(--mp-amber);
  color: #fff;
}
.mp-attention-pill svg { flex: none; color: var(--mp-amber); }
.mp-mobile-attention-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 0.58rem;
  padding: 0.15em 0.4em;
}
.mp-sidebar-bottom {
  border-top: 1px solid rgba(251, 248, 241, 0.14);
  padding-top: 0.9rem;
  margin-top: 0.75rem;
}
.mp-sidebar-user {
  font-size: 0.8rem;
  color: rgba(251, 248, 241, 0.75);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}
.mp-sidebar-role {
  color: rgba(251, 248, 241, 0.5);
  font-size: 0.74rem;
}

/* ---------- Mobile top bar (sidebar becomes an off-canvas drawer below lg) ---------- */
.mp-mobile-bar {
  background: linear-gradient(100deg, var(--mp-green-900) 0%, var(--mp-green-700) 130%);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.mp-mobile-bar .mp-mobile-brand { font-size: 1.15rem; }
.offcanvas-header .mp-mobile-brand { color: var(--mp-cream) !important; }
@media (min-width: 992px) {
  .mp-mobile-bar { display: none !important; }
}

.btn-mp-logout {
  background: transparent;
  border: 1.5px solid var(--mp-cream);
  color: var(--mp-cream);
  font-weight: 600;
  border-radius: var(--mp-radius-sm);
  padding: 0.3rem 0.75rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-mp-logout:hover {
  background: var(--mp-cream);
  border-color: var(--mp-cream);
  color: var(--mp-green-900);
}

/* ---------- Back / Home controls — live in the navbar itself ---------- */
.mp-nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(251, 248, 241, 0.08);
  border: 1px solid rgba(251, 248, 241, 0.3);
  color: var(--mp-cream);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.mp-nav-icon-btn:hover {
  background: var(--mp-amber);
  border-color: var(--mp-amber);
  color: #fff;
}
.mp-nav-icon-btn:active {
  transform: scale(0.94);
}

/* ---------- Breadcrumb ("you are here" trail) ---------- */
.mp-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--mp-ink-soft);
  margin-bottom: 1rem;
}
.mp-breadcrumb a {
  color: var(--mp-ink-soft);
  text-decoration: none;
  font-weight: 600;
}
.mp-breadcrumb a:hover { color: var(--mp-green-700); }
.mp-breadcrumb-sep { color: var(--mp-border); }
.mp-breadcrumb-group { font-weight: 600; color: var(--mp-ink-soft); }
.mp-breadcrumb-current { font-weight: 600; color: var(--mp-green-900); }

/* ---------- Cards ---------- */
.mp-card {
  background: #fff;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  box-shadow: var(--mp-shadow);
  padding: 1.5rem;
  align-items: center;
  margin:15px ;
  
}


.mp-stat {
  border-radius: var(--mp-radius-sm);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--mp-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a:hover > .mp-stat {
  transform: translateY(-2px);
  box-shadow: var(--mp-shadow);
  cursor: pointer;
}
.mp-stat--green { background: var(--mp-green-100); }
.mp-stat--blue { background: var(--mp-blue-light); }
.mp-stat--amber { background: var(--mp-amber-light); }
.mp-stat--red { background: var(--mp-red-light); }
.mp-stat .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mp-ink-soft);
  font-weight: 700;
}
.mp-stat .value {
  font-family: var(--mp-font-display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--mp-green-900);
  line-height: 1.15;
}
.mp-stat .value.live::after {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--mp-green-500);
  animation: mp-pulse 1.6s infinite;
  vertical-align: middle;
}
@keyframes mp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(63,143,104,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(63,143,104,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,143,104,0); }
}

/* ---------- Buttons ---------- */
.btn-mp-primary {
  background: linear-gradient(135deg, var(--mp-green-500) 0%, var(--mp-green-700) 100%);
  border-color: var(--mp-green-700);
  border-radius: var(--mp-radius-sm);
  color: #fff;
  font-weight: 600;
}
.btn-mp-primary:hover {
  background: linear-gradient(135deg, var(--mp-green-700) 0%, var(--mp-green-900) 100%);
  border-color: var(--mp-green-900);
  color: #fff;
}
.btn-mp-outline {
  border: 1.5px solid var(--mp-green-700);
  border-radius: var(--mp-radius-sm);
  color: var(--mp-green-700);
  font-weight: 600;
  background: transparent;
}
.btn-mp-outline:hover { background: var(--mp-green-700); color: #fff; }
.btn, .btn-sm, .form-control, .form-select, .input-group-text {
  border-radius: var(--mp-radius-sm) !important;
}

/* ---------- Forms ---------- */
.mp-form-panel {
  max-width: 460px;
  margin: 3rem auto;
  padding: 50px
  
 
}
.form-control, .form-select {
  border-color: var(--mp-border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--mp-green-500);
  box-shadow: 0 0 0 0.2rem rgba(63,143,104,0.18);
}
label { font-weight: 600; color: var(--mp-ink); font-size: 0.9rem; }

/* ---------- Tables ---------- */
.mp-table thead th {
  background: var(--mp-green-100);
  color: var(--mp-green-900);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: none;
}
.mp-table td, .mp-table th { vertical-align: middle; }

/* ---------- Status badges ----------
   Soft-pill treatment: tinted background + matching border + solid text,
   rather than a solid fill with white text - reads calmer in a table full
   of them and keeps the fill colors from competing with primary buttons. */
.badge-status-pending, .badge-status-approved, .badge-status-rejected,
.badge-status-clarification_requested, .text-bg-purple,
.badge-status-processed, .badge-status-disbursed {
  border-radius: var(--mp-radius-pill);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 0.32em 0.75em;
  border: 1px solid transparent;
}
.badge-status-pending { background: var(--mp-amber-light); color: var(--mp-amber); border-color: #ecd2a8; }
.badge-status-approved { background: var(--mp-blue-light); color: var(--mp-blue); border-color: #bfe0f2; }
.badge-status-rejected { background: var(--mp-red-light); color: var(--mp-red); border-color: #eec6bd; }
.badge-status-clarification_requested { background: #efecf7; color: #6a5a9e; border-color: #d8d0ec; }
.text-bg-purple { background: #efecf7; color: #6a5a9e; }
.badge-status-processed { background: var(--mp-blue-light); color: var(--mp-blue); border-color: #bfe0f2; }
.badge-status-disbursed { background: var(--mp-green-100); color: var(--mp-green-700); border-color: #c7e3d3; }

/* Bootstrap's own text-bg-* badges (used for vet-visit / order / appointment
   status elsewhere) get the same soft-pill treatment for consistency. */
.badge.rounded-pill, span.badge {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- Toasts / flash ---------- */
.mp-toast { border-radius: var(--mp-radius-sm); border: none; }

/* ---------- Misc ---------- */
.mp-section-title {
  font-family: var(--mp-font-display);
  color: var(--mp-green-900);
  border-bottom: 2px solid var(--mp-green-100);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}
.mp-footer {
  color: var(--mp-ink-soft);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem 1rem 1rem;
}
.mp-spinner-overlay {
  position: fixed; inset: 0; background: rgba(251,248,241,0.7);
  display: none; align-items: center; justify-content: center; z-index: 2000;
}
.mp-spinner-overlay.active { display: flex; }

/* ---------- Split-screen auth page (login.php) ---------- */
.mp-auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 992px) {
  .mp-auth-shell { flex-direction: row; }
}
.mp-auth-brand {
  flex: 0 0 auto;
  min-height: 220px;
  background:
    radial-gradient(circle at 15% 20%, rgba(251,248,241,0.10) 0%, transparent 45%),
    linear-gradient(155deg, var(--mp-green-500) 0%, var(--mp-green-900) 55%, #0f2118 100%);
  color: var(--mp-cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}
@media (min-width: 992px) {
  .mp-auth-brand {
    flex: 0 0 44%;
    min-height: 100vh;
    padding: 3rem 4rem;
  }
}
.mp-auth-brand .mp-drop {
  width: 20px; height: 26px;
  background: linear-gradient(160deg, var(--mp-amber) 0%, var(--mp-cream) 100%);
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  display: inline-block;
  margin-bottom: 1.5rem;
}
.mp-auth-brand h1 {
  color: var(--mp-cream);
  font-size: 2.1rem;
  max-width: 420px;
}
@media (min-width: 992px) {
  .mp-auth-brand h1 { font-size: 2.6rem; }
}
.mp-auth-brand p {
  color: rgba(251, 248, 241, 0.78);
  max-width: 380px;
  font-size: 1.02rem;
}
.mp-auth-brand-glow {
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,130,43,0.28) 0%, transparent 70%);
  bottom: -160px; right: -120px;
  pointer-events: none;
}
.mp-auth-form {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  background: var(--mp-cream);
}
.mp-auth-card {
  width: 100%;
  max-width: 400px;
}
.mp-auth-card .mp-back-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mp-ink-soft);
  text-decoration: none;
}
.mp-auth-card .mp-back-link:hover { color: var(--mp-green-900); }

/* ---------- Auth topbar: single Staff/Farmer toggle button ---------- */
/* Replaces the old "Log in as" <select> - a farmer never sees a dropdown
   of roles to cycle through; staff opt in with one click and can just as
   plainly switch back. */
.mp-auth-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}
.mp-mode-toggle-btn {
  background: transparent;
  border: 1.5px solid var(--mp-border);
  color: var(--mp-ink-soft);
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: var(--mp-radius-pill);
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mp-mode-toggle-btn:hover {
  border-color: var(--mp-green-700);
  color: var(--mp-green-700);
  background: var(--mp-green-100);
}
.mp-auth-shell[data-mode="staff"] .mp-mode-toggle-btn {
  border-color: var(--mp-green-700);
  background: var(--mp-green-100);
  color: var(--mp-green-700);
}
