/* Nesic Agro – izgled aplikacije */
:root {
  --brand: #0c5e1c;        /* boja logotipa */
  --brand-ink: #083f13;
  --green: #12962b;        /* glavna dugmad */
  --green-600: #0e7f23;
  --tint: #eaf6ec;
  --tint-2: #d4edd8;
  --ink: #16211a;
  --mut: #6a766d;
  --line: #e4eae5;
  --bg: #f5f7f5;
  --card: #ffffff;
  --red: #c2412d;   --red-tint: #fbeae7;
  --amber: #b97c0c; --amber-tint: #fdf2d8;
  --blue: #2a78c9;  --blue-tint: #e5effa;
  --gray-tint: #eef0ee;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 40, 20, .05), 0 4px 14px rgba(16, 40, 20, .05);
  --font: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 66px;
  --side-w: 240px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.45 var(--font); background: var(--bg); color: var(--ink); min-height: 100vh; }
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.ico { width: 20px; height: 20px; flex: none; }
.ico-cow { width: 22px; height: 22px; flex: none; display: inline-block; background: currentColor;
  -webkit-mask: url(../img/mark-green.png) center/contain no-repeat; mask: url(../img/mark-green.png) center/contain no-repeat; }
.num { font-variant-numeric: tabular-nums; }
.mut { color: var(--mut); }
.pos { color: var(--green-600); }
.neg { color: var(--red); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ── Splash ─────────────────────────────────────────── */
#splash { position: fixed; inset: 0; z-index: 100; background: var(--brand); display: grid; place-items: center; transition: opacity .35s ease, visibility .35s; }
#splash img { width: min(230px, 56vw); animation: pop .6s ease both; }
#splash.gone { opacity: 0; visibility: hidden; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Okvir ──────────────────────────────────────────── */
.app { min-height: 100vh; }
.side { display: none; }
.main { padding: 0 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 10px; padding: 14px 0 12px; margin: 0 -16px; padding-inline: 16px; }
.topbar h1 { font-size: 19px; color: var(--brand); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { font-size: 12.5px; color: var(--mut); font-weight: 400; display: block; }
.hello { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; flex: none; overflow: hidden; }
.avatar img { width: 70%; }
.avatar.letter { color: #fff; font-weight: 600; font-size: 17px; }
.hello h1 { font-size: 18px; }

.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; flex: none; color: var(--ink); }
.icon-btn:hover { background: var(--tint); }
.icon-btn.plain { border: 0; background: transparent; }

/* Donja navigacija (telefon) */
.bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--mut); position: relative; }
.bottom-nav a .ico, .bottom-nav a .ico-cow { width: 23px; height: 23px; }
.bottom-nav a.active { color: var(--green); font-weight: 500; }
.bottom-nav a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }

.fab { position: fixed; z-index: 31; right: 18px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%;
  background: var(--green); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(18, 150, 43, .38); }
.fab .ico { width: 28px; height: 28px; stroke-width: 2.6; }
.fab:active { transform: scale(.95); }

@media (min-width: 960px) {
  .bottom-nav { display: none; }
  .side { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--card); border-right: 1px solid var(--line); padding: 22px 14px; gap: 4px; z-index: 30; }
  .side .brand { display: flex; justify-content: center; padding: 4px 0 22px; }
  .side .brand img { width: 150px; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--mut); font-weight: 500; }
  .side a:hover { background: var(--bg); color: var(--ink); }
  .side a.active { background: var(--tint); color: var(--brand); }
  .side .grow { flex: 1; }
  .side .me { border-top: 1px solid var(--line); padding: 14px 6px 0; font-size: 13px; color: var(--mut); }
  .side .me b { color: var(--ink); display: block; font-size: 14px; }
  .app { padding-left: var(--side-w); }
  .main { padding: 0 32px 48px; }
  .topbar { margin: 0 -32px; padding: 22px 32px 16px; }
  .topbar h1 { font-size: 22px; }
  .fab { bottom: 32px; right: 32px; }
}

/* ── Kartice i raspored ─────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card, .card + .grid, .grid + .card, .grid + .grid, .stats + .card, .stats + .grid, .card + .stats, .section + .section { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 15.5px; flex: 1; }
.card-head .chip-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--tint); color: var(--green); display: grid; place-items: center; flex: none; }
.card-head .chip-ico .ico { width: 18px; height: 18px; }
.card-head .link { font-size: 13px; color: var(--green); font-weight: 500; }
.card-head .meta { font-size: 12.5px; color: var(--mut); }
.grid { display: grid; gap: 14px; }
.grid > *, .money > *, .stats > *, .animals > * { min-width: 0; }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.side-r { grid-template-columns: 1.5fr 1fr; } }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); font-weight: 500; margin: 22px 2px 10px; }

/* Pločice sa brojevima (kao u dizajnu) */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--tint); border: 1px solid var(--tint-2); border-radius: 14px; padding: 12px 6px 10px; text-align: center; color: var(--brand); position: relative; }
.stat .ico { width: 18px; height: 18px; color: var(--green); position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--card); border: 1px solid var(--tint-2); border-radius: 50%; padding: 4px; width: 26px; height: 26px; }
.stat b { display: block; font-size: 26px; font-weight: 600; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat span { font-size: 11.5px; color: var(--mut); }
.stat.warn { background: var(--amber-tint); border-color: #f3dfae; }
.stat.warn .ico { color: var(--amber); border-color: #f3dfae; }
a.stat:hover { border-color: var(--green); }

/* Novčani pregled */
.money { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .money { grid-template-columns: repeat(4, 1fr); } }
.money .m { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.money .m small { display: block; font-size: 12px; color: var(--mut); }
.money .m b { display: block; font-size: 20px; font-weight: 600; margin: 2px 0; font-variant-numeric: tabular-nums; }
.money .m em { font-style: normal; font-size: 12px; color: var(--mut); }
.money .m.hl { background: var(--brand); border-color: var(--brand); color: #fff; }
.money .m.hl small, .money .m.hl em { color: rgba(255, 255, 255, .78); }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: 14px; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.kv .total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 600; color: var(--ink); }

/* Liste */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
a.row:hover, .row.click:hover { background: var(--bg); cursor: pointer; }
.row .r-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--tint); color: var(--green); }
.row .r-ico.red { background: var(--red-tint); color: var(--red); }
.row .r-ico.blue { background: var(--blue-tint); color: var(--blue); }
.row .r-ico.amber { background: var(--amber-tint); color: var(--amber); }
.row .r-main { flex: 1; min-width: 0; }
.row .r-main b { display: block; font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-main span { display: block; font-size: 12.5px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-end { text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.row .r-end b { display: block; font-weight: 600; font-size: 14.5px; }
.row .r-end span { font-size: 12px; color: var(--mut); }
.row > .ico { color: var(--mut); }

/* Kartice grla */
.animals { display: grid; gap: 10px; }
@media (min-width: 760px) { .animals { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .animals { grid-template-columns: repeat(3, 1fr); } }
.acard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; box-shadow: var(--shadow); }
.acard:hover { border-color: var(--tint-2); background: #fbfdfb; }
.acard .a-ico { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--brand); display: grid; place-items: center; }
.acard .a-ico .ico-cow { width: 26px; height: 26px; }
.acard .a-ico.gray { background: var(--gray-tint); color: var(--mut); }
.acard .a-ico.red { background: var(--red-tint); color: var(--red); }
.acard .tag { font-weight: 600; font-size: 14.5px; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.acard .tag small { color: var(--mut); font-weight: 400; }
.acard .meta { font-size: 12.5px; color: var(--mut); grid-column: 2 / 4; }
.acard .badge { justify-self: end; }

/* Oznake */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--gray-tint); color: var(--mut); white-space: nowrap; }
.badge.green { background: var(--tint); color: var(--green-600); }
.badge.brand { background: var(--brand); color: #fff; }
.badge.blue { background: var(--blue-tint); color: var(--blue); }
.badge.amber { background: var(--amber-tint); color: var(--amber); }
.badge.red { background: var(--red-tint); color: var(--red); }
.badge.outline { background: transparent; border: 1px dashed var(--mut); }

/* Filteri */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; height: 44px; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%; }
.search .ico { color: var(--mut); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.chip b { font-weight: 600; margin-left: 4px; color: var(--mut); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip.on b { color: rgba(255,255,255,.85); }
.seg { display: inline-flex; background: var(--gray-tint); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: var(--mut); }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Dugmad */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--green); color: #fff; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--green-600); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--card); color: var(--green-600); border: 1.5px solid var(--green); }
.btn.ghost:hover { background: var(--tint); }
.btn.soft { background: var(--tint); color: var(--green-600); }
.btn.soft:hover { background: var(--tint-2); }
.btn.danger { background: var(--red); }
.btn.danger.ghost { background: var(--card); color: var(--red); border-color: var(--red); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.actions .btn { height: 42px; font-size: 14px; }

/* Forme */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 13px; color: var(--mut); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; height: 46px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 0 13px; outline: none; transition: border-color .15s, background .15s; }
.field textarea { height: auto; min-height: 76px; padding: 10px 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); background: var(--card); box-shadow: 0 0 0 3px rgba(18,150,43,.12); }
.field .hint { font-size: 12px; color: var(--mut); }
.field.err input { border-color: var(--red); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.calc { background: var(--tint); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--brand); }
.calc b { font-size: 17px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.form-actions .btn { flex: 1; }
@media (min-width: 760px) { .form-actions .btn { flex: 0 0 auto; min-width: 140px; } }
.pick { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; background: var(--bg); }
.pick label { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pick label:last-child { border-bottom: 0; }
.pick input { width: 18px; height: 18px; accent-color: var(--green); }
.pick .badge { margin-left: auto; }
.type-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-switch label { cursor: pointer; }
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch span { display: block; text-align: center; padding: 10px 4px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 14px; font-weight: 500; color: var(--mut); }
.type-switch input:checked + span { border-color: var(--green); background: var(--green); color: #fff; }
.type-switch input:checked + span.t-expense { border-color: var(--red); background: var(--red); }
.type-switch input:checked + span.t-deposit { border-color: var(--blue); background: var(--blue); }
.type-switch input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }

/* Sheet / dijalog */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(10, 25, 14, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.sheet-wrap.open { background: rgba(10, 25, 14, .42); }
.sheet { background: var(--card); width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .22s ease; padding-bottom: env(safe-area-inset-bottom); }
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; }
.sheet-head h3 { flex: 1; font-size: 17px; color: var(--brand); }
.sheet-body { padding: 6px 20px 22px; overflow: auto; }
@media (min-width: 760px) {
  .sheet-wrap { align-items: center; }
  .sheet { width: 520px; border-radius: 20px; transform: translateY(16px) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet.wide { width: 760px; }
  .sheet-wrap.open .sheet { opacity: 1; }
}
.confirm-msg { margin: 4px 0 14px; color: var(--ink); }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.menu-grid button { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 16px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; }
.menu-grid button:hover { border-color: var(--green); background: var(--tint); }
.menu-grid .mi { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--green); }
.menu-grid .mi.red { background: var(--red-tint); color: var(--red); }
.menu-grid .mi.blue { background: var(--blue-tint); color: var(--blue); }
.menu-grid .mi.amber { background: var(--amber-tint); color: var(--amber); }
.menu-grid .mi .ico-cow { width: 24px; height: 24px; }

/* Toast */
.toast { position: fixed; z-index: 80; left: 50%; top: 16px; transform: translate(-50%, -20px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; display: flex; gap: 8px; align-items: center; font-size: 14px; transition: .25s; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.ok .ico { color: #7ee08f; }
.toast.err { background: var(--red); }

/* Grafikoni */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: #c9d3cb; stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--mut); font-family: var(--font); }
.chart .bar-pos { fill: var(--green); }
.chart .bar-neg { fill: #e59a8c; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--mut); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut { display: flex; align-items: center; gap: 18px; }
.donut svg { width: 130px; height: 130px; flex: none; }
.donut-big { font-size: 22px; font-weight: 600; fill: var(--ink); font-family: var(--font); }
.donut-small { font-size: 9.5px; fill: var(--mut); font-family: var(--font); }
.donut ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.donut li { display: flex; align-items: center; gap: 8px; }
.donut li i { width: 9px; height: 9px; border-radius: 50%; }
.donut li b { min-width: 22px; font-variant-numeric: tabular-nums; }
.donut li span { color: var(--mut); }
.bars-h { display: grid; gap: 10px; }
.bars-h .b { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bars-h .track { height: 10px; background: var(--gray-tint); border-radius: 99px; overflow: hidden; }
.bars-h .fill { height: 100%; border-radius: 99px; background: var(--green); }

/* Tabele */
.table-wrap { overflow: auto; margin: 0 -16px; padding: 0 16px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.t th { color: var(--mut); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: var(--card); }
table.t td:first-child, table.t th:first-child { text-align: left; }
table.t tr.hl td { background: var(--red-tint); }
table.t tr.cur td { background: var(--tint); font-weight: 500; }
table.t input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--amber); }
.scroll-y { max-height: 460px; overflow: auto; }

/* Objekat (štala) */
.barn { display: grid; gap: 12px; }
@media (min-width: 760px) { .barn { grid-template-columns: repeat(3, 1fr); } }
.zone { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: var(--bg); }
.zone h3 { font-size: 14px; }
.zone p { margin: 2px 0 10px; font-size: 12px; color: var(--mut); }
.pens { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pen { background: var(--card); border: 2px solid var(--green); border-radius: 14px; padding: 10px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.pen:hover { box-shadow: 0 4px 14px rgba(18, 150, 43, .15); }
.pen.small { border-color: var(--blue); }
.pen.planned { border-style: dashed; border-color: #b9c4bb; background: transparent; cursor: default; }
.pen.full { border-color: var(--amber); }
.pen.over { border-color: var(--red); }
.pen .p-top { display: flex; justify-content: space-between; align-items: baseline; }
.pen .p-top b { font-size: 13.5px; }
.pen .p-cnt { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pen .p-cnt small { font-size: 13px; color: var(--mut); font-weight: 400; }
.pen .slots { display: flex; flex-wrap: wrap; gap: 5px; }
.pen .slot { width: 22px; height: 22px; border-radius: 7px; background: var(--gray-tint); border: 1px dashed #c8d0ca; }
.pen .slot.milk { background: var(--blue); border: 0; }
.pen .slot.calf { background: var(--green); border: 0; }
.pen .slot.fattening, .pen .slot.ready-long { background: var(--amber); border: 0; }
.pen .slot.ready { background: var(--brand); border: 0; }
.pen .p-foot { font-size: 11.5px; color: var(--mut); margin-top: auto; }

/* Karton grla */
.hero { background: var(--brand); color: #fff; border-radius: 20px; padding: 18px; display: flex; gap: 14px; align-items: center; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 170px; height: 170px; opacity: .08; background: #fff; -webkit-mask: url(../img/mark-green.png) center/contain no-repeat; mask: url(../img/mark-green.png) center/contain no-repeat; }
.hero .h-ico { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.hero .h-ico .ico-cow { width: 32px; height: 32px; background: #fff; }
.hero h2 { font-size: 20px; letter-spacing: .02em; }
.hero p { margin: 2px 0 0; color: rgba(255,255,255,.8); font-size: 13px; }
.hero .badge { background: rgba(255,255,255,.18); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.tile small { font-size: 11.5px; color: var(--mut); display: block; }
.tile b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline .row .r-ico { width: 32px; height: 32px; border-radius: 10px; }
.timeline .row .r-ico .ico { width: 16px; height: 16px; }

.empty { text-align: center; padding: 28px 10px; color: var(--mut); }
.empty .ico { width: 34px; height: 34px; color: #b8c4ba; }
.empty p { margin: 8px 0 0; font-size: 14px; }
.note { font-size: 12.5px; color: var(--mut); margin: 10px 0 0; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--amber-tint); color: #6d4a06; border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.notice .ico { color: var(--amber); margin-top: 1px; }
.notice.info { background: var(--blue-tint); color: #1d4f85; }
.notice.info .ico { color: var(--blue); }
.loading-page { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--tint-2); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }

.more-list .row { padding: 14px 4px; }
.scen { display: grid; gap: 10px; }
@media (min-width: 760px) { .scen { grid-template-columns: repeat(3, 1fr); } }
.scen .s { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; border-top: 4px solid var(--green); }
.scen .s h4 { font-size: 14px; margin-bottom: 6px; }
.scen .s p { margin: 3px 0; font-size: 13px; color: var(--mut); display: flex; justify-content: space-between; }
.scen .s p b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sim-inputs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 12px; }
@media (min-width: 760px) { .sim-inputs { grid-template-columns: repeat(4, 1fr); } }
.sim-inputs .field input, .sim-inputs .field select { height: 40px; }
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--green-600); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { margin-bottom: 12px; }
.dev-switch { font-size: 12px; }
