:root { --bg:#f3f5f2; --card:#fff; --ink:#1d1d1b; --muted:#6b6b66; --line:#e3e6df; --green:#1f7a3a; --green-d:#155d2b; --blue:#2563eb; --orange:#ea580c; --purple:#7c3aed; --bad:#b3261e; --warn:#8a6d00; --ok:#1f7a3a; }
* { box-sizing:border-box; }
html, body { margin:0; }
body { background:var(--bg); color:var(--ink); font:14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color:var(--green); }
h1 { font-size:22px; margin:0 0 4px; } h2 { font-size:16px; margin:0; } h3 { font-size:14px; margin:14px 0 6px; }
.muted { color:var(--muted); } .small { font-size:12px; } .bad { color:var(--bad); } .ok { color:var(--ok); } .warn { color:var(--warn); } .num { text-align:right; white-space:nowrap; }
code { background:#eef0ea; padding:1px 5px; border-radius:4px; }
.shell { display:flex; min-height:100vh; }
.side { width:220px; background:var(--green); color:#fff; padding:14px 10px; flex-shrink:0; }
.side .brand { display:flex; flex-direction:row; align-items:center; gap:8px; color:#fff; font-weight:700; font-size:16px; text-decoration:none; padding:6px 10px 14px; white-space:nowrap; }
.logo { font-size:20px; }
.side nav a { display:flex; justify-content:space-between; align-items:center; color:#e8f3ea; text-decoration:none; padding:9px 12px; border-radius:8px; font-size:14px; margin-bottom:2px; }
.side nav a:hover { background:rgba(255,255,255,.12); } .side nav a.active { background:#fff; color:var(--green-d); font-weight:600; }
.pill { background:var(--orange); color:#fff; border-radius:999px; font-size:11px; padding:1px 7px; margin-left:6px; }
.mainwrap { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar { display:flex; align-items:center; gap:14px; padding:10px 24px; background:var(--card); border-bottom:1px solid var(--line); }
.topbar select { padding:6px 8px; border:1px solid var(--line); border-radius:6px; }
.topbar .date { color:var(--muted); } .spacer { flex:1; }
.iconlink { text-decoration:none; }
.avatar { width:32px; height:32px; border-radius:50%; background:var(--ink); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; }
.who { display:inline-flex; flex-direction:column; line-height:1.1; } .who small { color:var(--muted); }
main { padding:22px 24px 60px; max-width:1400px; width:100%; }
@media (max-width: 900px) { .shell { flex-direction:column; } .side { width:auto; } .side nav { display:flex; flex-wrap:wrap; gap:2px; } .side nav a { padding:6px 10px; font-size:13px; } main { padding:14px; } }
.authpage { background:var(--bg); } .authwrap { max-width:440px; margin:60px auto; padding:0 16px; }
.brand.big { font-size:22px; font-weight:700; margin-bottom:14px; display:flex; gap:8px; align-items:center; }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px 18px; margin-bottom:16px; }
.cardhead { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.cols { display:grid; grid-template-columns:1fr 1fr; gap:16px; } .cols > .card { margin-bottom:16px; }
@media (max-width: 1000px) { .cols { grid-template-columns:1fr; } }
.pagehead { display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:14px; flex-wrap:wrap; }
.tabs { display:flex; gap:4px; background:#e9ece6; padding:3px; border-radius:8px; }
.tabs a { padding:6px 12px; border-radius:6px; text-decoration:none; color:var(--ink); font-size:13px; } .tabs a.on { background:#fff; font-weight:600; color:var(--green-d); }
.filters { display:flex; gap:14px; align-items:flex-end; flex-wrap:wrap; padding:12px 16px; } .filters label { display:flex; flex-direction:column; font-size:12px; color:var(--muted); gap:3px; }
.filters input, .filters select { padding:7px 8px; border:1px solid var(--line); border-radius:6px; font-size:14px; }
.kpis { display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; margin-bottom:16px; }
.kpis.small { grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); }
.kpi { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 16px; display:flex; flex-direction:column; gap:2px; text-decoration:none; color:var(--ink); }
.kpi b { font-size:22px; } .kpi span { color:var(--muted); font-size:13px; display:flex; flex-direction:column; } .kpi small { font-size:11px; }
.kpi .ic { width:34px; height:34px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; font-size:18px; background:#eef2ea; margin-bottom:6px; }
.kpi.green { background:#e9f6ec; } .kpi.blue { background:#e8effd; } .kpi.orange { background:#fdeee5; } .kpi.purple { background:#f1eafe; }
.kpi.bad b { color:var(--bad); } .kpi.ok b { color:var(--ok); }
@media (max-width: 1000px) { .kpis { grid-template-columns:repeat(2, 1fr); } }
.quick { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.btn, button.btn { display:inline-block; background:var(--green); color:#fff; border:0; padding:9px 14px; border-radius:8px; font-size:14px; cursor:pointer; text-decoration:none; font-weight:600; }
.btn.blue { background:var(--blue); } .btn.orange { background:var(--orange); } .btn.purple { background:var(--purple); } .btn.green { background:var(--green); }
.btn.secondary, button.secondary { background:#fff; color:var(--ink); border:1px solid var(--line); font-weight:500; }
.btn.small { padding:5px 10px; font-size:13px; }
button { font:inherit; } button.link { background:none; border:0; color:var(--green); padding:0; cursor:pointer; font-size:inherit; }
form.inline { display:inline; }
.actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px; }
table { border-collapse:collapse; width:100%; font-size:13.5px; }
th, td { border-bottom:1px solid var(--line); padding:7px 8px; text-align:left; vertical-align:top; }
th { color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.03em; }
tfoot th, tfoot td { border-top:2px solid var(--line); border-bottom:0; text-transform:none; font-size:13.5px; color:var(--ink); }
.badge { display:inline-block; font-size:11px; text-transform:uppercase; letter-spacing:.04em; padding:2px 8px; border-radius:999px; background:#eee; white-space:nowrap; }
.st-active, .st-harvesting, .st-extracted, .st-linked, .st-settled, .st-delivered, .st-approved, .st-done { background:#dff3e6; color:var(--ok); }
.st-planned, .st-pending, .st-needs_review, .st-recorded, .st-received, .st-processing, .st-loaded { background:#fff3cd; color:var(--warn); }
.st-dispatched, .st-in_transit { background:#e8effd; color:var(--blue); }
.st-failed, .st-rejected, .st-cancelled { background:#fde3e1; color:var(--bad); }
.st-closed, .st-draft { background:#eee; color:#555; }
.badge.type { background:#e8eef9; color:#2a4b8d; }
.badge.conf-high { background:#dff3e6; color:var(--ok); } .badge.conf-medium { background:#fff3cd; color:var(--warn); } .badge.conf-low { background:#fde3e1; color:var(--bad); }
.chip { display:inline-block; padding:3px 10px; margin:2px 4px 2px 0; border:1px solid var(--line); border-radius:999px; background:var(--card); text-decoration:none; color:var(--ink); font-size:13px; }
.chip.active { background:var(--green); color:#fff; border-color:var(--green); }
.farmgrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:12px; }
.farm { display:block; border:1px solid var(--line); border-radius:10px; padding:12px; text-decoration:none; color:var(--ink); background:#fbfcfa; }
.farmtop { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.crop { font-size:12px; color:var(--muted); }
.farmname { font-weight:700; font-size:15px; display:flex; flex-direction:column; text-decoration:none; color:var(--ink); } .farmname small { color:var(--muted); font-weight:400; }
.money { font-weight:700; font-size:16px; }
.bar { height:8px; background:#e6eae3; border-radius:999px; overflow:hidden; margin:8px 0 4px; } .bar div { height:100%; background:var(--green); }
.split2 { display:flex; justify-content:space-between; color:var(--muted); }
.farmrow { display:flex; gap:16px; align-items:center; } .farmrow-main { flex:1; min-width:0; } .farmrow-actions { display:flex; flex-direction:column; gap:6px; }
.facts { display:flex; gap:22px; flex-wrap:wrap; margin:10px 0; } .facts div { display:flex; flex-direction:column; } .facts small { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.03em; } .facts b { font-size:15px; }
.alert { display:flex; flex-direction:column; padding:10px 12px; border-radius:8px; margin-bottom:8px; text-decoration:none; color:var(--ink); border-left:4px solid var(--green); background:#f6f8f4; }
.alert.warn { border-left-color:var(--warn); background:#fff8e1; } .alert.bad { border-left-color:var(--bad); background:#fdf0ef; } .alert span { color:var(--muted); font-size:13px; }
.repgrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:12px; } .rep { text-decoration:none; color:var(--ink); display:flex; flex-direction:column; gap:4px; }
.formgrid { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px 16px; } .formgrid.tight { gap:8px 12px; margin-top:10px; }
.formgrid .wide, .formgrid fieldset, .formgrid .actions, .formgrid .docbanner, .formgrid p { grid-column:1 / -1; }
@media (max-width: 900px) { .formgrid { grid-template-columns:1fr 1fr; } } @media (max-width: 600px) { .formgrid { grid-template-columns:1fr; } }
label.f { display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted); font-weight:600; }
label.f em { color:var(--bad); font-style:normal; } label.f small { font-weight:400; }
label.f input, label.f select, label.f textarea { padding:8px 10px; border:1px solid var(--line); border-radius:6px; font-size:14px; color:var(--ink); background:#fff; width:100%; }
fieldset { border:1px solid var(--line); border-radius:8px; padding:10px 12px; } legend { font-size:12px; color:var(--muted); font-weight:600; }
.row3 { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; }
.docbanner { background:#eef6ff; border:1px solid #cfe0fb; padding:8px 12px; border-radius:8px; font-size:13px; }
table.lines input, table.lines select { padding:6px 8px; border:1px solid var(--line); border-radius:6px; font-size:13px; }
.kv { display:grid; grid-template-columns:max-content 1fr; gap:4px 14px; margin:0 0 10px; font-size:14px; } .kv dt { color:var(--muted); } .kv dd { margin:0; font-weight:600; }
form.review { display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; margin-top:12px; padding-top:10px; border-top:1px solid var(--line); }
form.review label { margin:0; font-size:13px; } form.review select { padding:7px 8px; border:1px solid var(--line); border-radius:6px; font-size:14px; } form.review button { margin:0; }
.note { background:var(--card); border:1px solid var(--line); border-radius:12px; margin-bottom:18px; overflow:hidden; }
.note-head { display:flex; gap:12px; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line); flex-wrap:wrap; } .time { font-weight:600; }
.split { display:grid; grid-template-columns:1fr 1fr; }
.split figure { margin:0; padding:14px; border-right:1px solid var(--line); background:#fafaf7; } .split img { width:100%; height:auto; border-radius:6px; border:1px solid var(--line); }
.split figcaption { font-size:12px; color:var(--muted); margin-top:6px; } .split .text { padding:14px 18px; overflow-x:auto; }
.md table { font-size:13px; } .md pre { background:#f3f2ee; padding:10px; border-radius:6px; overflow:auto; }
details { margin-top:12px; } summary { cursor:pointer; font-weight:600; }
.devnote { background:#fff6d6; border:1px solid #f0dc8c; padding:8px 10px; border-radius:6px; }
.narrow { max-width:440px; } .error { color:var(--bad); }
label { display:block; } .narrow input { width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:6px; font-size:15px; margin:6px 0 12px; }
@media (max-width: 760px) { .split { grid-template-columns:1fr; } .split figure { border-right:0; border-bottom:1px solid var(--line); } }
@media print { .side, .topbar, .btn, button, .actions { display:none !important; } main { padding:0; } .card { border:0; } }

.brandtext { display:flex; flex-direction:column; line-height:1.15; } .brandtext small { font-weight:400; font-size:11px; color:#cfe6d4; }
.side { display:flex; flex-direction:column; } .side nav { flex:1; }
.powered { font-size:11px; color:#cfe6d4; padding:14px 12px 4px; } .powered b { color:#fff; font-weight:600; }
.powered.auth { text-align:center; color:var(--muted); margin-top:18px; } .powered.auth b { color:var(--ink); }
