/* =====================================================================
   WAKULIMA MILK FARMERS - MAIN STYLESHEET
   ---------------------------------------------------------------------
   Design tokens (colors, fonts) are declared once as CSS variables
   at the top, then reused everywhere. Change a value here and it
   updates the whole site.
   ===================================================================== */

:root {
  /* --- Brand colors: green (growth/dairy), blue (trust), white (clean) --- */
  --wk-green-dark: #0f5c33;   /* deep pasture green - headings, navbar */
  --wk-green: #1f9d55;        /* primary buttons, active states */
  --wk-green-light: #e8f7ee;  /* soft green backgrounds */
  --wk-blue: #2d7dd2;         /* secondary accent - links, icons */
  --wk-blue-light: #eaf3fc;   /* soft blue backgrounds */
  --wk-white: #ffffff;
  --wk-bg: #f4f8f6;           /* page background, slightly green-tinted white */
  --wk-text: #1f2a24;         /* main text color */
  --wk-text-muted: #6b7a72;   /* secondary text */
  --wk-border: #e2ece6;
  --wk-danger: #e34a4a;
  --wk-warning: #e2a63b;

  /* --- Shape & shadow --- */
  --wk-radius: 16px;
  --wk-radius-sm: 10px;
  --wk-shadow: 0 10px 30px rgba(15, 92, 51, 0.08);
  --wk-shadow-soft: 0 4px 14px rgba(15, 92, 51, 0.06);

  /* --- Fonts --- */
  --wk-font-display: 'Poppins', sans-serif;
  --wk-font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: var(--wk-font-body);
  background-color: var(--wk-bg);
  color: var(--wk-text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .display-font {
  font-family: var(--wk-font-display);
  color: var(--wk-green-dark);
  font-weight: 600;
}

a { text-decoration: none; }

/* =====================================================================
   REUSABLE PIECES
   ===================================================================== */

/* Little "milk drop" logo mark used on navbar and auth pages */
.wk-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--wk-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--wk-green-dark);
}
.wk-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--wk-green) 0%, var(--wk-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: var(--wk-shadow-soft);
}

/* Rounded card with soft shadow, used across the whole app */
.wk-card {
  background: var(--wk-white);
  border: 1px solid var(--wk-border);
  border-radius: var(--wk-radius);
  box-shadow: var(--wk-shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease;
}
.wk-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--wk-shadow);
}

/* Primary button - green, used for main actions */
.btn-wk-primary {
  background: linear-gradient(135deg, var(--wk-green) 0%, var(--wk-green-dark) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: var(--wk-radius-sm);
  padding: 0.7rem 1.4rem;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  box-shadow: 0 6px 16px rgba(31, 157, 85, 0.28);
}
.btn-wk-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(31, 157, 85, 0.32);
  color: #fff;
}
.btn-wk-primary:active { transform: translateY(0); }
.btn-wk-primary:disabled { opacity: 0.7; transform: none; }

.btn-wk-outline {
  border: 1.5px solid var(--wk-green);
  color: var(--wk-green-dark);
  font-weight: 600;
  border-radius: var(--wk-radius-sm);
  background: transparent;
  padding: 0.65rem 1.3rem;
  transition: all .15s ease;
}
.btn-wk-outline:hover {
  background: var(--wk-green-light);
  color: var(--wk-green-dark);
}

/* Form inputs */
.form-control.wk-input, .form-select.wk-input {
  border-radius: var(--wk-radius-sm);
  border: 1.5px solid var(--wk-border);
  padding: 0.7rem 0.9rem;
  font-size: 0.96rem;
  background-color: #fbfdfc;
}
.form-control.wk-input:focus, .form-select.wk-input:focus {
  border-color: var(--wk-green);
  box-shadow: 0 0 0 0.2rem rgba(31, 157, 85, 0.15);
  background-color: #fff;
}
.wk-input-group {
  position: relative;
}
.wk-input-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--wk-text-muted);
}
.wk-input-group .wk-input { padding-left: 42px; }
.wk-toggle-password {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--wk-text-muted);
  background: none;
  border: none;
}

/* =====================================================================
   AUTH PAGES (login / register)
   ===================================================================== */
.wk-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

/* Left decorative panel - illustration + brand story */
.wk-auth-visual {
  flex: 1.1;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.12), transparent 40%),
              linear-gradient(160deg, var(--wk-green-dark) 0%, var(--wk-green) 55%, var(--wk-blue) 130%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.wk-auth-visual::before {
  /* soft wave shape at the bottom for a liquid/milk feel */
  content: "";
  position: absolute;
  left: -10%;
  bottom: -20%;
  width: 130%;
  height: 60%;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.wk-auth-visual .wk-illustration {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: auto 0;
}
.wk-auth-visual .wk-illustration img { max-width: 320px; width: 100%; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.2)); }
.wk-auth-visual h2 { color: #fff; font-size: 1.9rem; }
.wk-auth-visual p { color: rgba(255,255,255,0.85); max-width: 380px; }

.wk-auth-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--wk-white);
}
.wk-auth-form-inner { width: 100%; max-width: 420px; }

@media (max-width: 900px) {
  .wk-auth-visual { display: none; } /* keep it simple & fast on mobile */
}

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.wk-navbar {
  background: var(--wk-white);
  border-bottom: 1px solid var(--wk-border);
  box-shadow: 0 2px 10px rgba(15,92,51,0.04);
}

.wk-page-title { font-size: 1.5rem; }

.wk-stat-card {
  padding: 1.4rem 1.5rem;
  height: 100%;
}
.wk-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.9rem;
}
.wk-stat-icon.bg-green { background: var(--wk-green-light); color: var(--wk-green-dark); }
.wk-stat-icon.bg-blue  { background: var(--wk-blue-light); color: var(--wk-blue); }
.wk-stat-icon.bg-warn  { background: #fdf2e2; color: var(--wk-warning); }
.wk-stat-icon.bg-danger{ background: #fbe8e8; color: var(--wk-danger); }

.wk-stat-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wk-text-muted);
  margin-bottom: 0.2rem;
}
.wk-stat-value {
  font-family: var(--wk-font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--wk-text);
}

/* Net pay hero card */
.wk-netpay-card {
  background: linear-gradient(135deg, var(--wk-green-dark) 0%, var(--wk-green) 60%, var(--wk-blue) 140%);
  color: #fff;
  border-radius: var(--wk-radius);
  padding: 2rem;
  box-shadow: var(--wk-shadow);
  position: relative;
  overflow: hidden;
}
.wk-netpay-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.wk-netpay-card .wk-stat-label { color: rgba(255,255,255,0.8); }
.wk-netpay-card .wk-netpay-value {
  font-family: var(--wk-font-display);
  font-size: 2.6rem;
  font-weight: 700;
}

/* Milk fill progress bar - a small "signature" touch */
.wk-milk-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--wk-green-light);
  overflow: hidden;
}
.wk-milk-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wk-blue), var(--wk-green));
  width: 0%;
  transition: width 1s ease;
}

.wk-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--wk-border);
  font-size: 0.95rem;
}
.wk-breakdown-row:last-child { border-bottom: none; }

/* Fade/slide-in animation for cards on load */
.wk-animate-in {
  animation: wkFadeUp .5s ease both;
}
@keyframes wkFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toast container tweak */
.toast-container { z-index: 1080; }

/* Loading spinner overlay on buttons */
.wk-btn-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}
.wk-loading .wk-btn-spinner { display: inline-block; }
.wk-loading .wk-btn-text { opacity: 0.85; }

/* Footer */
.wk-footer {
  color: var(--wk-text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 0;
}
