/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green-900: #14532d;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --red-500:   #ef4444;
  --red-100:   #fee2e2;
  --gray-900:  #111827;
  --gray-700:  #374151;
  --gray-500:  #6b7280;
  --gray-300:  #d1d5db;
  --gray-100:  #f3f4f6;
  --gray-50:   #f9fafb;
  --white:     #ffffff;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 2px 8px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
}
body { font-family: 'Inter', ui-sans-serif, system-ui, sans-serif; font-size: 14px; color: var(--gray-900); background: var(--gray-50); line-height: 1.5; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea { font-family: inherit; font-size: 14px; }
button { font-family: inherit; cursor: pointer; }

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-green { color: var(--green-600); }
.text-red   { color: var(--red-500); }
.optional   { color: var(--gray-500); font-size: 12px; font-weight: 400; }
.hint       { color: var(--gray-500); font-size: 12px; }
.empty-msg  { color: var(--gray-500); font-size: 13px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; border: none;
  transition: all .15s ease; cursor: pointer;
}
.btn-primary  { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-900); text-decoration: none; }
.btn-ghost    { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-ghost:hover { background: var(--gray-100); text-decoration: none; }
.btn-success  { background: var(--green-600); color: #fff; }
.btn-success:hover { background: var(--green-700); }
.btn-sm  { padding: 5px 12px; font-size: 13px; }
.btn-xs  { padding: 3px 8px;  font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Form fields ─────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 500; font-size: 13px; color: var(--gray-700); }
.field input, .field select, .field textarea {
  padding: 9px 12px; border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm); background: var(--white);
  transition: border-color .15s;
  color: var(--gray-900);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Nav ─────────────────────────────────────────────────── */
.nav { background: var(--white); border-bottom: 1px solid var(--gray-300); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 16px; }
.nav-brand { font-weight: 700; font-size: 16px; color: var(--green-900); flex-shrink: 0; }
.nav-brand:hover { text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.farm-switcher {
  padding: 5px 10px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; background: var(--gray-50); max-width: 180px;
}
.avatar-menu { position: relative; }
.avatar-btn {
  width: 34px; height: 34px; border-radius: 50%; background: var(--green-700);
  color: white; font-weight: 700; font-size: 14px; border: none; cursor: pointer;
}
.dropdown {
  display: none; position: absolute; right: 0; top: 42px;
  background: var(--white); border: 1px solid var(--gray-300);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; padding: 6px 0; z-index: 200;
}
.avatar-menu.open .dropdown { display: block; }
.dropdown a, .dropdown span { display: block; padding: 8px 16px; font-size: 13px; color: var(--gray-700); }
.dropdown a:hover { background: var(--gray-50); text-decoration: none; }
.dropdown-name { font-weight: 600; color: var(--gray-900); border-bottom: 1px solid var(--gray-100); }

/* ── Auth / Landing ──────────────────────────────────────── */
.auth-body { background: var(--gray-50); }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-hero {
  background: linear-gradient(145deg, var(--green-900) 0%, #166534 60%, #15803d 100%);
  display: flex; align-items: center; justify-content: center; padding: 60px 40px;
}
.auth-hero-inner { max-width: 380px; color: white; }
.auth-logo { font-size: 56px; margin-bottom: 16px; }
.auth-hero h1 { font-size: 32px; font-weight: 700; line-height: 1.2; margin-bottom: 12px; }
.auth-tagline { font-size: 15px; opacity: .8; margin-bottom: 40px; }
.auth-features { display: flex; flex-direction: column; gap: 14px; }
.auth-feature { display: flex; align-items: center; gap: 12px; font-size: 14px; opacity: .9; }
.feat-icon { font-size: 20px; flex-shrink: 0; }
.auth-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 60px 48px; background: var(--white); }
.auth-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 28px; }
.auth-tab { background: none; border: none; padding: 10px 20px; font-size: 15px; font-weight: 500; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tab.active { color: var(--green-700); border-bottom-color: var(--green-700); }
.auth-form { display: flex; flex-direction: column; gap: 18px; max-width: 360px; }
.form-error-banner { background: var(--red-100); color: var(--red-500); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.auth-footer-note { margin-top: 24px; font-size: 12px; color: var(--gray-500); }
@media (max-width: 700px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-form-panel { padding: 40px 24px; }
}

/* ── Onboarding ───────────────────────────────────────────── */
.onboard-wrap { display: flex; justify-content: center; align-items: flex-start; padding: 40px 20px; min-height: calc(100vh - 56px); }
.onboard-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 40px; width: 100%; max-width: 580px; }
.onboard-header { text-align: center; margin-bottom: 36px; }
.onboard-emoji { font-size: 48px; }
.onboard-header h2 { font-size: 24px; font-weight: 700; margin: 12px 0 8px; }
.onboard-header p { color: var(--gray-500); }
.step { display: none; flex-direction: column; gap: 20px; }
.step.active { display: flex; }
.step-label { font-size: 12px; font-weight: 600; color: var(--green-700); text-transform: uppercase; letter-spacing: .05em; }
.step-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.option-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.option-card { display: flex; cursor: pointer; }
.option-card input { display: none; }
.card-body { border: 2px solid var(--gray-200); border-radius: var(--radius); padding: 12px 14px; width: 100%; transition: all .15s; }
.option-card.selected .card-body, .option-card input:checked ~ .card-body { border-color: var(--green-600); background: var(--green-50); }
.card-title { font-weight: 600; font-size: 14px; color: var(--gray-900); }
.card-sub { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

/* ── Dashboard layout ─────────────────────────────────────── */
.dash-layout { max-width: 1100px; margin: 0 auto; padding: 24px 20px; display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .dash-layout { grid-template-columns: 1fr; } .dash-side { display: none; } }

/* Farm header */
.dash-farm-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.farm-title { font-size: 20px; font-weight: 700; }
.farm-meta { font-size: 13px; color: var(--gray-500); }

/* Setup card */
.setup-card { display: flex; align-items: center; gap: 16px; background: var(--amber-100); border: 1px solid #fcd34d; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.setup-icon { font-size: 28px; flex-shrink: 0; }
.setup-title { font-weight: 600; font-size: 14px; }
.setup-desc { font-size: 13px; color: var(--gray-600); margin-top: 2px; }

/* Status strip */
.status-strip { display: flex; align-items: stretch; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.stat-item { flex: 1; padding: 14px 16px; text-align: center; }
.stat-val { font-size: 20px; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.stat-stage { font-size: 14px; }
.stat-label { font-size: 11px; color: var(--gray-500); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.stat-sep { width: 1px; background: var(--gray-200); margin: 12px 0; flex-shrink: 0; }

/* Today card */
.today-card { border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.today-urgent  { background: #fff1f2; border: 1.5px solid #fca5a5; }
.today-upcoming{ background: #fffbeb; border: 1.5px solid #fcd34d; }
.today-ok      { background: var(--green-50); border: 1.5px solid #86efac; }
.today-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 20px; margin-bottom: 8px; }
.today-badge-urgent  { background: #fca5a5; color: #991b1b; }
.today-badge-upcoming{ background: #fde68a; color: #92400e; }
.today-badge-ok      { background: #86efac; color: #14532d; }
.today-msg { font-size: 14px; line-height: 1.6; color: var(--gray-800); }

/* Section card */
.section-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.section-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-weight: 600; font-size: 14px; }

/* LCC input */
.lcc-input-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lcc-panels { display: flex; gap: 6px; }
.lcc-panel {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 2px solid transparent; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .15s; color: #1a2e1a;
}
.lcc-panel:hover { border-color: var(--gray-400); }
.lcc-panel.lcc-selected { border-color: var(--gray-900); box-shadow: 0 0 0 2px rgba(0,0,0,.2); }
.lcc-result-msg { font-size: 13px; color: var(--green-700); margin-top: 8px; }
.lcc-advice { margin-top: 10px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.lcc-advice-alert { background: #fff1f2; color: #991b1b; }
.lcc-advice-ok    { background: var(--green-50); color: #14532d; }

/* Timeline */
.timeline-bar { position: relative; height: 28px; margin-bottom: 6px; }
.tl-track { position: absolute; bottom: 6px; left: 0; right: 0; height: 4px; background: var(--gray-200); border-radius: 2px; z-index: 0; }
.tl-event {
  position: absolute; height: 20px; top: 4px; border-radius: 4px;
  font-size: 10px; font-weight: 700; color: white; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  min-width: 8px; overflow: hidden;
}
.tl-now      { background: #dc2626; }
.tl-upcoming { background: var(--amber-500); }
.tl-future   { background: var(--green-500); }
.tl-past     { background: var(--gray-400); }
.tl-done     { background: var(--green-600); opacity: .7; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; z-index: 2; border-radius: 1px; }
.tl-today::after { content: '▲'; position: absolute; bottom: -2px; left: -5px; font-size: 10px; color: #dc2626; }
.tl-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--gray-500); margin-bottom: 14px; }

/* Event list */
.event-list { display: flex; flex-direction: column; gap: 8px; }
.event-row {
  border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--gray-50);
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: start;
}
.event-row.event-now      { border-color: #fca5a5; background: #fff5f5; }
.event-row.event-upcoming { border-color: #fde68a; background: #fffdf0; }
.event-row.event-done     { opacity: .6; }
.event-left { display: flex; gap: 10px; align-items: flex-start; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); flex-shrink: 0; margin-top: 5px; }
.event-name { font-weight: 500; font-size: 13px; }
.event-range { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.event-nutrients { display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-start; }
.nutrient-badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 12px; white-space: nowrap; }
.n-badge   { background: #dbeafe; color: #1e40af; }
.p-badge   { background: #fce7f3; color: #9d174d; }
.k-badge   { background: #d1fae5; color: #065f46; }
.org-badge { background: #fef3c7; color: #92400e; }
.cao-badge { background: #f3f4f6; color: #374151; }
.event-detail { font-size: 13px; color: var(--gray-600); line-height: 1.6; margin-top: 8px; grid-column: 1/-1; background: var(--white); padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--gray-200); }
.mark-done-btn { white-space: nowrap; }
.event-expand-btn { align-self: flex-start; white-space: nowrap; }

/* Quick actions */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.quick-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s; color: var(--gray-700);
  text-decoration: none;
}
.quick-action-btn:hover { background: var(--green-50); border-color: var(--green-300); color: var(--green-700); text-decoration: none; }
.quick-action-btn span:first-child { font-size: 20px; }

/* Side cards */
.side-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.side-card-title { font-weight: 600; font-size: 13px; color: var(--gray-700); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .04em; }
.npk-rows { display: flex; flex-direction: column; gap: 10px; }
.npk-row { display: grid; grid-template-columns: 42px 1fr 48px; align-items: center; gap: 8px; }
.npk-label { font-size: 12px; font-weight: 600; color: var(--gray-600); }
.npk-bar-wrap { height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.npk-bar { height: 100%; border-radius: 4px; transition: width .4s ease; }
.npk-n   { background: #3b82f6; }
.npk-p   { background: #ec4899; }
.npk-k   { background: var(--green-500); }
.npk-cao { background: var(--gray-400); }
.npk-org { background: var(--amber-500); }
.npk-val { font-size: 12px; font-weight: 600; text-align: right; color: var(--gray-700); }
.npk-total-note { font-size: 11px; color: var(--gray-500); margin-top: 12px; }
.npk-totals { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-top: 4px; }

/* LCC history side */
.lcc-history { display: flex; flex-direction: column; gap: 8px; }
.lcc-hist-row { display: grid; grid-template-columns: 46px 1fr 28px; align-items: center; gap: 8px; }
.lcc-hist-das { font-size: 11px; color: var(--gray-500); }
.lcc-hist-bar-wrap { height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.lcc-hist-bar { height: 100%; border-radius: 4px; }
.lcc-ok  { background: var(--green-500); }
.lcc-low { background: var(--red-500); }
.lcc-hist-val { font-size: 12px; font-weight: 700; text-align: right; }
.lcc-threshold-note { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* Farm summary */
.farm-summary { display: flex; flex-direction: column; gap: 8px; }
.fs-row { display: flex; justify-content: space-between; font-size: 13px; }
.fs-row span:first-child { color: var(--gray-500); }
.fs-row span:last-child { font-weight: 500; }

/* Straw drawer */
.drawer { position: fixed; bottom: 0; left: 0; right: 0; background: var(--white); border-top: 1px solid var(--gray-200); box-shadow: var(--shadow-lg); z-index: 300; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.drawer-inner { max-width: 700px; margin: 0 auto; padding: 20px 24px 32px; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.drawer-header h3 { font-size: 16px; font-weight: 700; }
.drawer-header button { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--gray-500); }
.straw-fact { background: var(--green-50); border: 1px solid #86efac; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.straw-donts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.straw-dont { background: #fff1f2; border-left: 3px solid #f87171; padding: 8px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; color: #991b1b; }
.straw-rec  { background: var(--green-50); border-left: 3px solid var(--green-500); padding: 8px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; color: #14532d; margin-bottom: 6px; }

/* ── Diagnose page ────────────────────────────────────────── */
.page-wrap { max-width: 900px; margin: 0 auto; padding: 28px 20px; }
.page-header { margin-bottom: 24px; }
.back-link { font-size: 13px; color: var(--gray-500); display: inline-block; margin-bottom: 8px; }
.back-link:hover { color: var(--green-700); }
.page-header h2 { font-size: 22px; font-weight: 700; }
.page-desc { color: var(--gray-500); margin-top: 4px; }
.diagnose-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 700px) { .diagnose-layout { grid-template-columns: 1fr; } }
.diagnose-form-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.leaf-options { display: flex; gap: 8px; flex-wrap: wrap; }
.leaf-btn { padding: 7px 14px; border: 1.5px solid var(--gray-300); border-radius: 20px; background: var(--white); font-size: 13px; color: var(--gray-700); cursor: pointer; transition: all .15s; }
.leaf-btn.active { border-color: var(--green-600); background: var(--green-50); color: var(--green-700); }
.symptom-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.sym-chip { padding: 6px 12px; border: 1.5px solid var(--gray-300); border-radius: 20px; background: var(--white); font-size: 12px; color: var(--gray-700); cursor: pointer; transition: all .15s; }
.sym-chip.active { border-color: var(--green-600); background: var(--green-50); color: var(--green-700); font-weight: 500; }
.diagnose-results { display: flex; flex-direction: column; gap: 12px; }
.diag-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px; }
.diag-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.diag-medal { font-size: 18px; }
.diag-name { font-weight: 700; font-size: 14px; flex: 1; }
.diag-severity { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.diag-match { font-size: 11px; color: var(--gray-500); background: var(--gray-100); padding: 2px 8px; border-radius: 12px; }
.diag-desc { font-size: 13px; color: var(--gray-600); margin-bottom: 10px; line-height: 1.6; }
.diag-mgmt-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.diag-mgmt ol { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.diag-mgmt li { font-size: 13px; line-height: 1.5; }
.diag-empty { color: var(--gray-500); padding: 20px; text-align: center; }

/* ── Settings page ───────────────────────────────────────── */
.settings-form { max-width: 640px; display: flex; flex-direction: column; gap: 24px; }
.settings-section { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.settings-section-title { font-weight: 700; font-size: 14px; color: var(--gray-700); padding-bottom: 8px; border-bottom: 1px solid var(--gray-100); }
.settings-actions { display: flex; justify-content: flex-end; gap: 10px; padding-bottom: 40px; }

/* ── Products / Buy list ──────────────────────────────────── */
.picker-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
@media (max-width: 640px) { .picker-row { grid-template-columns: 1fr; } }

.buy-season-totals { background: var(--green-50); border: 1px solid #86efac; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.buy-total-title { font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.buy-totals-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.buy-total-item { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 10px 14px; min-width: 130px; }
.buy-total-name { font-weight: 500; font-size: 13px; }
.buy-total-bags { font-size: 18px; font-weight: 700; color: var(--green-700); }
.buy-total-kg { font-size: 12px; color: var(--gray-500); }
.buy-total-cost { font-size: 12px; color: var(--amber-500); font-weight: 600; margin-top: 2px; }
.buy-grand-total { margin-top: 14px; font-size: 15px; font-weight: 700; color: var(--green-900); }

.split-buy-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.split-buy-now      { border-color: #fca5a5; background: #fff5f5; }
.split-buy-upcoming { border-color: #fde68a; background: #fffdf0; }
.split-buy-past     { opacity: .7; }
.split-buy-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.split-buy-name { font-weight: 600; font-size: 14px; }
.split-buy-das { font-size: 12px; color: var(--gray-500); margin-top: 3px; }
.split-buy-targets { display: flex; gap: 5px; flex-wrap: wrap; }
.nbadge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; background: #dbeafe; color: #1e40af; }
.pbadge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; background: #fce7f3; color: #9d174d; }
.kbadge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; background: #d1fae5; color: #065f46; }
.product-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.product-row { display: flex; align-items: center; justify-content: space-between; background: var(--gray-50); border-radius: var(--radius-sm); padding: 8px 12px; gap: 12px; flex-wrap: wrap; }
.product-row-name { font-weight: 500; font-size: 13px; }
.product-row-detail { font-size: 13px; color: var(--gray-600); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.sep { color: var(--gray-300); }
.split-buy-instructions { font-size: 13px; color: var(--gray-600); line-height: 1.6; margin-bottom: 10px; }
.split-buy-no-products { font-size: 13px; color: var(--gray-400); }
.log-application-row { display: flex; justify-content: flex-end; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; overflow: hidden; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--gray-200); }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-header button { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--gray-500); }
.modal-body { padding: 18px 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--gray-200); }

/* Application log table */
.log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-table th { text-align: left; padding: 8px 10px; background: var(--gray-50); font-weight: 600; font-size: 12px; color: var(--gray-600); border-bottom: 1px solid var(--gray-200); }
.log-table td { padding: 8px 10px; border-bottom: 1px solid var(--gray-100); }
.log-table tr:hover td { background: var(--gray-50); }

/* Add "Buy List" link to nav inside dashboard quick-actions */
.quick-action-link { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s; color: var(--gray-700); text-decoration: none; }
.quick-action-link:hover { background: var(--green-50); border-color: #86efac; color: var(--green-700); text-decoration: none; }

/* Weather banner */
.weather-warn-banner { display: flex; align-items: flex-start; gap: 10px; background: #fef3c7; border: 1px solid #fcd34d; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 1rem; font-size: 14px; color: #92400e; line-height: 1.5; }
.weather-warn-icon { font-size: 20px; flex-shrink: 0; }
.weather-info-strip { display: flex; align-items: center; gap: 16px; background: var(--gray-50); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 1rem; font-size: 13px; color: var(--gray-600); }
.weather-rain { margin-left: auto; }

/* Error page */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; gap: 1rem; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--green-700); line-height: 1; }
.error-title { font-size: 1.5rem; font-weight: 700; color: var(--gray-800); }
.error-msg { font-size: 1rem; color: var(--gray-500); max-width: 400px; }

/* History page */
.history-record-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.history-record-title { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 16px; }
.history-table-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow-sm); }
.history-table-title { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th { text-align: left; padding: 8px 12px; background: var(--gray-50); font-weight: 600; font-size: 12px; color: var(--gray-600); border-bottom: 2px solid var(--gray-200); white-space: nowrap; }
.history-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); }
.history-table tr:hover td { background: var(--gray-50); }
.season-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
.season-dong_xuan { background: #dbeafe; color: #1e40af; }
.season-he_thu { background: #d1fae5; color: #065f46; }
.season-thu_dong { background: #fce7f3; color: #9d174d; }
.yield-good { color: #16a34a; font-weight: 600; }
.yield-ok { color: #d97706; font-weight: 600; }
.yield-poor { color: #dc2626; font-weight: 600; }
.notes-cell { color: var(--gray-500); font-size: 12px; }
.history-stats { display: flex; gap: 24px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--gray-100); flex-wrap: wrap; }
.hstat { text-align: center; }
.hstat-val { font-size: 1.75rem; font-weight: 800; color: var(--green-700); line-height: 1; }
.hstat-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.history-empty { text-align: center; padding: 48px 24px; color: var(--gray-500); background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); }
.history-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.yield-chart-wrap { margin-bottom: 16px; }
.save-msg { margin-top: 10px; font-size: 13px; font-weight: 500; }
.season-form .field-hint, .field-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* Photo diagnosis */
.photo-card { margin-top: 20px; }
.photo-card-title { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }
.photo-card-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }
.photo-drop { border: 2px dashed var(--gray-200); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; transition: border-color .15s; }
.photo-drop:hover { border-color: var(--green-500); }
.photo-drop-icon { font-size: 2rem; margin-bottom: 6px; }
.photo-loading { text-align: center; padding: 12px; font-size: 14px; color: var(--green-700); font-weight: 500; }
.diag-disclaimer { margin-top: 10px; font-size: 12px; color: var(--gray-400); font-style: italic; }
.diag-symptoms { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.photo-result-card { border-left: 4px solid var(--green-500); }

/* Profile check field */
.field-check { display: flex; flex-direction: column; justify-content: flex-end; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; cursor: pointer; }
.check-label input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
