/* ===========================================================
   MarketMama FARM MANAGEMENT — AfriERP Theme
   Clean, bold, green-first, farmer-friendly
=========================================================== */

/* ---------- Design Tokens ---------- */

:root {
  --mm-bg: #f1f5f9;
  --mm-bg-soft: #e5e7eb;
  --mm-surface: #ffffff;
  --mm-surface-soft: #f9fafb;
  --mm-border-subtle: #e5e7eb;
  --mm-border-strong: #cbd5f5;

  --mm-text-main: #0f172a;
  --mm-text-muted: #6b7280;
  --mm-text-soft: #9ca3af;

  --mm-accent: #16a34a;
  --mm-accent-soft: #dcfce7;
  --mm-accent-deep: #166534;

  --mm-accent-blue: #2563eb;
  --mm-accent-blue-soft: #dbeafe;

  --mm-danger: #b91c1c;
  --mm-danger-soft: #fee2e2;

  --mm-warning: #f97316;
  --mm-warning-soft: #ffedd5;

  --mm-radius-lg: 1rem;
  --mm-radius-md: 0.75rem;
  --mm-radius-sm: 0.5rem;

  --mm-shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
  --mm-shadow-card: 0 8px 20px rgba(15, 23, 42, 0.05);

  --mm-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", "Segoe UI", sans-serif;
}

/* ---------- Global Reset-ish ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--mm-font-sans);
  color: var(--mm-text-main);
  background: var(--mm-bg);
}

img {
  max-width: 100%;
  display: block;
}

/* Links */

a {
  color: var(--mm-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================================================
   AUTH PAGES (Login / Signup)
=========================================================== */

body.login-page {
  min-height: 100vh;
  background: radial-gradient(circle at top, #dcfce7 0, #f1f5f9 40%, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.mm-login-shell {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .mm-login-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* Brand / hero block */

.mm-logo-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mm-logo-circle {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: #022c22;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(22, 101, 52, 0.45);
  margin-bottom: 0.5rem;
}

.mm-logo-circle--small {
  width: 40px;
  height: 40px;
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.35);
}

.mm-logo {
  width: 70%;
  height: auto;
}

.mm-brand {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--mm-accent-deep);
}

.mm-tagline {
  font-size: 0.95rem;
  color: var(--mm-text-muted);
  max-width: 340px;
}

/* Small pill features */

.mm-feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.mm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 600;
}

.mm-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--mm-accent);
}

/* Language selector */

.mm-lang-switcher {
  margin-top: 0.75rem;
}

.mm-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--mm-text-main);
}

.mm-field span {
  font-weight: 600;
}

/* Auth card */

.mm-auth-card {
  background: var(--mm-surface);
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow-soft);
  padding: 1.5rem 1.7rem;
}

.mm-auth-card-bright {
  background: #f9fafb;
}

.mm-auth-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
}

.mm-auth-subtitle {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  color: var(--mm-text-muted);
}

.mm-auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Inputs */

.mm-auth-form input,
.mm-lang-switcher select,
.mm-field input,
.mm-field select {
  border-radius: 0.6rem;
  border: 1px solid var(--mm-border-subtle);
  padding: 0.55rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #f9fafb;
  color: var(--mm-text-main);
}

.mm-auth-form input:focus,
.mm-field input:focus,
.mm-field select:focus,
.mm-lang-switcher select:focus {
  outline: 2px solid var(--mm-accent-soft);
  outline-offset: 1px;
  border-color: var(--mm-accent);
  background: #ffffff;
}

/* Error */

.mm-error {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--mm-danger);
}

/* Auth footer */

.mm-auth-footer {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--mm-text-muted);
}

.mm-link {
  font-weight: 600;
}

/* Buttons */

.mm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  background: #e5e7eb;
  color: var(--mm-text-main);
}

.mm-btn-primary {
  background: var(--mm-accent);
  color: #ecfdf5;
  border-color: var(--mm-accent);
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.4);
}

.mm-btn-primary:hover {
  background: #15803d;
}

.mm-btn-primary-bright {
  background: var(--mm-accent-blue);
  border-color: var(--mm-accent-blue);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
  color: #eff6ff;
}

.mm-btn-ghost {
  background: transparent;
  border-color: var(--mm-border-subtle);
  color: var(--mm-text-main);
}

/* Back button on inner pages */

.mm-back-btn {
  border-radius: 999px;
  padding-inline: 0.9rem;
}

/* ===========================================================
   AfriERP SHELL (used on Dashboard + other main pages)
=========================================================== */

.mm-pro-page {
  min-height: 100vh;
  background: var(--mm-bg);
  display: flex;
  flex-direction: column;
}

/* Header */

.mm-pro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.3rem;
  background: linear-gradient(to right, #022c22, #064e3b);
  color: #e5f9f0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.4);
  position: sticky;
  top: 0;
  z-index: 20;
}

.mm-pro-header-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.mm-pro-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.mm-pro-subtitle {
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* AfriERP header buttons */

.mm-pro-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mm-pro-btn {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.mm-pro-btn-primary {
  background: var(--mm-accent);
  color: #ecfdf5;
}

.mm-pro-btn-ghost {
  background: transparent;
  color: #e5f9f0;
  border: 1px solid rgba(226, 232, 240, 0.45);
}

/* Main */

.mm-pro-main {
  flex: 1;
  padding: 1rem 1.2rem 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin-inline: auto;
}

.mm-pro-section {
  background: var(--mm-surface);
  border-radius: var(--mm-radius-lg);
  padding: 1rem 1.05rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--mm-shadow-card);
}

.mm-pro-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
}

/* ===========================================================
   DASHBOARD STYLES
=========================================================== */

.mm-dashboard-page {
  background: var(--mm-bg);
}

/* Older header style (if used elsewhere) */

.mm-dash-header {
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mm-dash-header-left,
.mm-dash-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mm-dash-business-name {
  font-size: 1rem;
  font-weight: 800;
}

.mm-dash-plan-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mm-dash-plan-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--mm-accent-soft);
  color: var(--mm-accent-deep);
  font-size: 0.75rem;
  font-weight: 700;
}

.mm-dash-plan-meta {
  font-size: 0.75rem;
  color: var(--mm-text-soft);
}

/* Main */

.mm-dash-main {
  padding: 1rem;
}

/* Greeting card */

.mm-dash-greeting-card {
  background: var(--mm-surface);
  border-radius: var(--mm-radius-lg);
  padding: 1rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--mm-shadow-card);
}

.mm-dash-greeting {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
}

.mm-dash-greeting-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--mm-text-muted);
}

/* KPI Cards */

.mm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
}

.mm-kpi-card {
  border-radius: var(--mm-radius-md);
  padding: 0.7rem 0.8rem;
  color: #ffffff;
  box-shadow: var(--mm-shadow-card);
}

.mm-kpi-label {
  font-size: 0.8rem;
  opacity: 0.9;
}

.mm-kpi-value {
  margin-top: 0.1rem;
  font-size: 1.1rem;
  font-weight: 800;
}

/* KPI palette */

.mm-green {
  background: linear-gradient(to bottom right, #16a34a, #15803d);
}

.mm-red {
  background: linear-gradient(to bottom right, #ef4444, #b91c1c);
}

.mm-blue {
  background: linear-gradient(to bottom right, #2563eb, #1d4ed8);
}

.mm-orange {
  background: linear-gradient(to bottom right, #f97316, #ea580c);
}

/* Tiles (Farm, Business, People, Reports) */

.mm-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
}

.mm-dash-tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--mm-radius-md);
  background: var(--mm-surface);
  border: 1px solid var(--mm-border-subtle);
  text-decoration: none;
  color: var(--mm-text-main);
  box-shadow: var(--mm-shadow-card);
}

.mm-dash-tile h2,
.mm-dash-tile h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.mm-dash-tile p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--mm-text-muted);
}

/* Colour categories */

.mm-tile-farm {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.mm-tile-business {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.mm-tile-people {
  background: #fdf2ff;
  border-color: #f5d0fe;
}

.mm-tile-reports {
  background: #fff7ed;
  border-color: #fed7aa;
}

/* Banner */

.mm-dash-banner {
  margin-top: 1.2rem;
  border-radius: var(--mm-radius-md);
  padding: 0.8rem 0.9rem;
  background: var(--mm-warning-soft);
  border: 1px solid #fed7aa;
}

/* ===========================================================
   GENERIC CONTENT / SECTIONS
=========================================================== */

.mm-section {
  background: var(--mm-surface);
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow-card);
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
}

/* Tables (if you have .mm-table anywhere) */

.mm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.mm-table th,
.mm-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--mm-border-subtle);
}

.mm-table th {
  text-align: left;
  background: var(--mm-bg-soft);
  font-weight: 700;
}

/* Tags / Badges */

.mm-tag,
.mm-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.mm-tag-green {
  background: var(--mm-accent-soft);
  color: var(--mm-accent-deep);
}

.mm-tag-red {
  background: var(--mm-danger-soft);
  color: var(--mm-danger);
}

/* Forms on inner pages */

.mm-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

/* ===========================================================
   RESPONSIVE
=========================================================== */

@media (max-width: 768px) {
  .mm-pro-main {
    padding-inline: 0.75rem;
  }

  .mm-pro-section {
    padding-inline: 0.8rem;
  }

  .mm-dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mm-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mm-login-shell {
    padding-top: 0.5rem;
  }
}
/* ============================================================
   COMPAT LAYER — GHANA FEED + FARM ACTIVITIES + REPORTS
   (Restores lost styles for Ghana Feed and finance reports)
============================================================ */

/* ---------- Ghana Feed form fields ---------- */

.gf-field-group {
  margin-bottom: 14px;
}

.gf-field-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #111827;
}

.gf-field-group input,
.gf-field-group select,
.gf-field-group textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background: #ffffff;
}

.gf-field-group textarea {
  min-height: 60px;
  resize: vertical;
}

.gf-field-group input:focus,
.gf-field-group select:focus,
.gf-field-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

/* Ghana Feed primary button */

.gf-btn-primary {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  font-size: 1rem;
  background: #16a34a;
  color: #ffffff;
  margin-top: 8px;
  cursor: pointer;
}

.gf-btn-primary:hover {
  background: #15803d;
}

.gf-success,
.gf-error {
  font-size: 0.85rem;
  margin-top: 6px;
}

.gf-success {
  color: #15803d;
}
.gf-error {
  color: #b91c1c;
}

/* ---------- Ghana Feed FARM ACTIVITIES pages ---------- */

body.mm-dashboard-page.gf-activity-page {
  background: #f3f4f6;
  color: #111827;
}

/* KPI row (pills) */

.gf-kpi-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.gf-kpi-pill {
  background: #eff6ff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: #1d4ed8;
  font-weight: 700;
}

/* ---------- Ghana Feed FARM NOTEBOOK ---------- */

body.mm-dashboard-page.gf-farm-page {
  background: #f3f4f6;
  color: #111827;
}

/* Notebook sections */

.gf-section {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

/* ---------- Ghana Feed FARMERS & GH pages ---------- */

.gh-section {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.gh-section h2 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  font-weight: 800;
}

/* Summary cards */

.gh-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.gh-summary-card {
  background: #0b1120;
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.7);
}

.gh-summary-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-bottom: 2px;
}

.gh-summary-main {
  font-size: 1.1rem;
  font-weight: 800;
}

.gh-summary-sub {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Filters + table */

.gh-filter-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr;
  gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 700px) {
  .gh-filter-row {
    grid-template-columns: 1fr 1fr;
  }
}

.gh-filter-input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background: #ffffff;
}

.gh-table-wrapper {
  overflow-x: auto;
}

/* Detail overlay */

.gh-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.gh-detail-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  max-width: 420px;
  width: 92%;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
}

.gh-detail-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.gh-detail-card p {
  margin: 2px 0;
  font-size: 0.9rem;
  color: #4b5563;
}

.gh-detail-close {
  margin-top: 10px;
  text-align: right;
}

.gh-detail-close button {
  border: none;
  background: #9ca3af;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.gh-view-btn {
  border: none;
  background: #2563eb;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Finance REPORT pages (PL / Cashflow / BS / Investor) ---------- */

.mm-report-grid,
.mm-cf-grid,
.mm-bs-grid,
.mm-ir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin-top: 25px;
}

/* P&L */

.mm-report-card {
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mm-report-card h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.mm-report-main {
  font-size: 1.8rem;
  font-weight: 900;
  margin-top: 5px;
}

.mm-report-sub {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 8px;
  line-height: 1.3;
}

/* Cashflow */

.mm-cf-card {
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mm-cf-card h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.mm-cf-main {
  font-size: 1.8rem;
  font-weight: 900;
  margin-top: 5px;
}

.mm-cf-sub {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 8px;
  line-height: 1.3;
}

/* Balance sheet */

.mm-bs-card {
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mm-bs-card h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.mm-bs-main {
  margin-top: 8px;
  font-size: 1.8rem;
  font-weight: 900;
}

.mm-bs-sub {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 10px;
}

/* Investor report */

.mm-ir-card {
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.mm-ir-card h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}
.mm-alert-critical {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 18px;
  border-radius: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.mm-alert-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  padding: 18px;
  border-radius: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.mm-alert-good {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 18px;
  border-radius: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}
