/* Agrofarmers · sistema de diseño compartido (admin + campo)
   Verde de marca #48AF54 tomado del logotipo. Neutros con tinte verde. */
:root {
  --bg: #F2F6F0; --surface: #FFFFFF; --surface2: #E8F0E6; --ink: #12241A; --muted: #52665A; --line: #D3E0D0;
  --brand: #48AF54; --btn-bg: #237A33; --btn-fg: #FFFFFF; --brand-soft: #DDF1DF; --brand-ink: #1B6329;
  --warn: #8F5200; --warn-bg: #FFF0D2; --bad: #B3261E; --bad-bg: #FCE3E0; --info: #1A5CA5; --info-bg: #E0EDFA;
  --shadow: 0 1px 2px rgba(18, 36, 26, .08), 0 4px 14px rgba(18, 36, 26, .06);
  --radius: 14px; --radius-sm: 10px;
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D150F; --surface: #15211A; --surface2: #1D2C22; --ink: #E5EFE6; --muted: #9BB1A0; --line: #293D2E;
    --brand: #5DC169; --btn-bg: #5DC169; --btn-fg: #07230F; --brand-soft: #1B3A22; --brand-ink: #7FD789;
    --warn: #F0B35A; --warn-bg: #3A2A0E; --bad: #FF8A80; --bad-bg: #3F1B18; --info: #8DBDF0; --info-bg: #14283F;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D150F; --surface: #15211A; --surface2: #1D2C22; --ink: #E5EFE6; --muted: #9BB1A0; --line: #293D2E;
  --brand: #5DC169; --btn-bg: #5DC169; --btn-fg: #07230F; --brand-soft: #1B3A22; --brand-ink: #7FD789;
  --warn: #F0B35A; --warn-bg: #3A2A0E; --bad: #FF8A80; --bad-bg: #3F1B18; --info: #8DBDF0; --info-bg: #14283F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; font-weight: 800; text-wrap: balance; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .75rem; }
.eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sp { flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; text-decoration: none; color: var(--ink); transition: transform .06s, background .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.btn.danger { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand-ink); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn.lg { min-height: 56px; font-size: 1.1rem; border-radius: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: .8rem; font-weight: 700; color: var(--muted); }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--btn-bg); flex: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: .78rem; font-weight: 800; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--brand-soft); color: var(--brand-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); max-width: 440px; animation: pop .2s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.overlay { position: fixed; inset: 0; background: rgba(8, 20, 12, .55); z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92%; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); animation: up .22s ease-out; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: -6px auto 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } .sheet .grab { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.scroll-x { overflow-x: auto; max-width: 100%; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
