/* =========================
   FARMSIDE CREATIVE THEME
========================= */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Earthy Color Palette */
  --primary-dark: #203A27;    /* Deep Forest Green */
  --primary: #3A5A40;         /* Classic Green */
  --primary-light: #588157;   /* Leaf Green */
  --sage: #A3B18A;            /* Light Sage */
  
  --accent-earth: #BC6C25;    /* Terracotta / Clay */
  --accent-sun: #DDA15E;      /* Warm Harvest Yellow */
  
  --bg-main: #FDFBF7;         /* Warm Off-White */
  --bg-card: #FFFFFF;
  --bg-alt: #F4F1EA;          /* Creamy Beige */

  --text-main: #2D312E;
  --text-muted: #646A66;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;

  --shadow-sm: 0 4px 12px rgba(32, 58, 39, 0.05);
  --shadow-md: 0 12px 24px rgba(32, 58, 39, 0.08);
  --shadow-lg: 0 20px 40px rgba(32, 58, 39, 0.12);
  --shadow-hover: 0 16px 32px rgba(188, 108, 37, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  color: var(--primary-dark);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* =========================
   NAVBAR
========================= */
nav {
  background: rgba(253, 251, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--primary-dark);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(163, 177, 138, 0.2);
}

nav .logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-right: auto;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
}

nav a {
  color: var(--primary-dark);
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

nav a:hover, nav a.active {
  background: var(--sage);
  color: var(--primary-dark);
}

/* =========================
   PAGE TITLES
========================= */
.page-title {
  text-align: center;
  font-size: 2.8rem;
  margin: 40px 0 10px;
  color: var(--primary-dark);
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-earth);
  border-radius: 2px;
}

/* =========================
   DASHBOARD CARDS
========================= */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.card {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(163, 177, 138, 0.15);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--sage));
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}

.card:hover::before {
  opacity: 1;
}

.card h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

/* Base button styles */
.btn, form button, .job-card .apply-btn, .edit-btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--primary-dark);
  color: #fff;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(32, 58, 39, 0.2);
  text-align: center;
}

.btn:hover, form button:hover, .job-card .apply-btn:hover, .edit-btn:hover {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(32, 58, 39, 0.3);
  color: #fff;
}

/* =========================
   FORMS
========================= */
form, .form-container, .settings-container {
  max-width: 600px;
  margin: 40px auto;
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(163, 177, 138, 0.2);
}

form label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 500;
  color: var(--primary-dark);
  font-size: 0.95rem;
}

form input, form select, form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid transparent;
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  transition: all 0.3s ease;
}

form input:focus, form select:focus, form textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(163, 177, 138, 0.15);
}

/* =========================
   NOTIFICATIONS
========================= */
.notification-container {
  max-width: 800px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 20px;
}

.notification-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(163, 177, 138, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.notification-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-md);
}

.notification-card .icon {
  font-size: 2rem;
  margin-right: 20px;
  background: var(--bg-alt);
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}

.notification-card p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--primary-dark);
}

.notification-card small {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: block; margin-top: 4px;
}

/* Notification Types */
.notification-card.success { border-left: 6px solid #4caf50; }
.notification-card.payment { border-left: 6px solid var(--accent-earth); }
.notification-card.info { border-left: 6px solid #2196f3; }
.notification-card.update { border-left: 6px solid #9c27b0; }
.notification-card.market { border-left: 6px solid #3f51b5; }
.notification-card.alert { border-left: 6px solid #f44336; }
.notification-card.machine { border-left: 6px solid var(--accent-sun); }

/* =========================
   JOBS
========================= */
.jobs-container {
  max-width: 1000px;
  margin: 40px auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 0 20px;
}

.job-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(163, 177, 138, 0.2);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.job-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-sun);
}

.job-card h3 {
  color: var(--primary-dark);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.job-card p {
  margin: 6px 0;
  color: var(--text-muted);
}

.job-card .apply-btn {
  margin-top: auto;
  align-self: flex-start;
  margin-top: 20px;
  background: var(--accent-earth);
  box-shadow: 0 4px 10px rgba(188, 108, 37, 0.2);
}
.job-card .apply-btn:hover {
  background: #A65A1A;
}

/* =========================
   REPORTS
========================= */
.reports-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.report-card {
  flex: 1 1 280px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  text-align: center;
  border: 1px solid rgba(163, 177, 138, 0.2);
}

.report-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: var(--sage);
}

.report-card h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

/* =========================
   WEATHER
========================= */
.weather-container {
  max-width: 900px;
  margin: 40px auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  padding: 0 20px;
}

.weather-card {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  padding: 30px 20px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255, 0.1);
}

.weather-card::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.weather-card h3 {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  margin-bottom: 16px;
  font-size: 1.2rem;
}

/* =========================
   ABOUT / SERVICES
========================= */
.section-container {
  max-width: 1000px;
  margin: 60px auto;
  text-align: center;
  padding: 0 20px;
}

.section-container h2 {
  font-size: 2.5rem;
  margin-bottom: 24px;
}

.section-container p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 30px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.service-card {
  background: var(--bg-card);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  border: 1px solid rgba(163, 177, 138, 0.2);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  background: var(--bg-alt);
}

/* =========================
   DARK MODE - Earthy Night
========================= */
body.dark, body.dark-mode {
  --bg-main: #1A201C;
  --bg-card: #222924;
  --bg-alt: #2D352F;
  --text-main: #E8E5DF;
  --text-muted: #A3B18A;
  --primary-dark: #A3B18A; 
}

body.dark nav, body.dark-mode nav {
  background: rgba(34, 41, 36, 0.85);
  border-bottom: 1px solid rgba(163, 177, 138, 0.1);
}

body.dark .card, body.dark form, body.dark-mode .card, body.dark-mode form, 
body.dark .notification-card, body.dark .job-card, body.dark .service-card {
  border-color: rgba(255,255,255, 0.05);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* =========================
   PROFILE
========================= */
.profile-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 40px 20px;
}

.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  max-width: 450px;
  width: 100%;
  text-align: center;
  border: 1px solid rgba(163, 177, 138, 0.2);
}

.profile-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 4px solid var(--accent-sun);
  padding: 4px;
  background: var(--bg-main);
  object-fit: cover;
}

.profile-card h2 {
  font-size: 2rem;
}

.profile-card .role {
  color: var(--accent-earth);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* =========================
   FOOTER
========================= */
footer {
  text-align: center;
  padding: 30px;
  background: var(--primary-dark);
  color: var(--sage);
  margin-top: 60px;
  font-size: 0.95rem;
}

/* =========================
   BACK BUTTON
========================= */
#backBtn {
  position: fixed;
  top: 90px;
  left: 24px;
  z-index: 9999;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(58, 90, 64, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#backBtn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(58, 90, 64, 0.5);
  background: var(--primary-dark);
}

/* =========================
   HAMBURGER
========================= */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1000;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--primary-dark);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* =========================
   MOBILE RESPONSIVE
========================= */
@media (max-width: 768px) {
  nav {
    padding: 12px 20px;
    flex-wrap: wrap;
  }
  
  .hamburger {
    display: flex;
  }

  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    margin-top: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px 0;
    box-shadow: var(--shadow-md);
  }

  nav ul.open { display: flex; }

  nav ul li a {
    display: block;
    padding: 12px 20px;
    border-radius: 0;
  }

  nav > a { display: none; }
  nav.mobile-open > a {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

  .dashboard, .jobs-container, .weather-container {
    grid-template-columns: 1fr;
  }
  
  form, .form-container, .card, .profile-card {
    margin: 20px;
    padding: 24px;
    width: auto;
  }

  .page-title {
    font-size: 2.2rem;
    margin: 30px 0;
  }
}

/* =========================
   TABLES (Ledgers, History)
========================= */
.table-container {
  overflow-x: auto;
  margin: 20px auto;
  max-width: 1200px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(163, 177, 138, 0.2);
  padding: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead {
  background-color: var(--primary-light);
  color: white;
}

th, td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(163, 177, 138, 0.15);
}

th {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  font-weight: 500;
  color: white;
}

tbody tr {
  transition: background-color 0.3s ease;
}

tbody tr:hover {
  background-color: var(--bg-alt);
}

.paid-status {
  color: var(--primary);
  font-weight: 600;
}