/* ============ MobFerma Bot — тёмно-зелёная тема ============ */
:root {
  --bg: #0f1510;
  --bg-2: #141c15;
  --card: #18221a;
  --card-2: #1f2b21;
  --card-3: #263428;
  --ink: #ecf2e4;
  --ink-2: #c3cfba;
  --muted: #84937e;
  --line: #2a382c;
  --line-2: #354637;
  --green: #7bd15a;
  --green-d: #58b03a;
  --green-l: rgba(123, 209, 90, .14);
  --gold: #f2b84b;
  --gold-l: rgba(242, 184, 75, .14);
  --red: #f0705f;
  --red-l: rgba(240, 112, 95, .14);
  --blue: #6cb6f0;
  --blue-l: rgba(108, 182, 240, .14);
  --violet: #b59cf5;
  --violet-l: rgba(181, 156, 245, .14);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -14px rgba(0, 0, 0, .7);
  --r: 18px;
  --side: 268px;
  --top: 58px;
  --bar: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 600 14px/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body { background: radial-gradient(900px 500px at 85% -10%, rgba(123, 209, 90, .10), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(108, 182, 240, .05), transparent 60%), var(--bg); background-attachment: fixed; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); }
::selection { background: rgba(123, 209, 90, .3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.gi { width: 22px; height: 22px; object-fit: contain; flex: none; }

/* ============ каркас ============ */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px; background: linear-gradient(180deg, #152017, #111a12); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; z-index: 30; }
.main { min-width: 0; padding: 24px 30px 80px; max-width: 1440px; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 12px; }
.brand-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: linear-gradient(145deg, #8fd16a, #3f8f1f); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 8px 18px -8px #5cc236; flex: none; }
.brand b { font-size: 18px; font-weight: 900; letter-spacing: -.01em; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 12px; }
.side-close { display: none; margin-left: auto; width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.side-label { font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.acc-list { display: flex; flex-direction: column; gap: 4px; }
.acc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; background: transparent; text-align: left; width: 100%; }
.acc:hover { background: var(--card); }
.acc.on { background: var(--card-2); border-color: var(--line-2); }
.acc .ava { position: relative; width: 38px; height: 38px; border-radius: 12px; background: var(--card-3); flex: none; }
.acc .ava img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.acc .ava .dot { position: absolute; right: -3px; bottom: -3px; border: 2px solid #131c14; }
.acc .meta { min-width: 0; }
.acc .meta b { display: block; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .meta small { color: var(--muted); font-size: 12px; }
.side-add { margin: 6px 0 4px; border: 1px dashed var(--line-2); background: transparent; border-radius: 12px; padding: 8px; color: var(--muted); cursor: pointer; font-weight: 800; }
.side-add:hover { color: var(--green); border-color: var(--green); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .grp { font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav button { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; text-align: left; font-weight: 800; color: var(--ink-2); }
.nav button .i { width: 26px; height: 26px; display: grid; place-items: center; font-size: 17px; flex: none; }
.nav button .i img { width: 26px; height: 26px; object-fit: contain; }
.nav button:hover { background: var(--card); color: var(--ink); }
.nav button.on { background: var(--green-l); color: var(--green); }
.nav button.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--green); }
.nav button .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.side-link { border: 0; background: transparent; text-align: left; padding: 7px 12px; border-radius: 10px; color: var(--muted); cursor: pointer; font-weight: 800; }
.side-link:hover { color: var(--ink); background: var(--card); }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.running { background: var(--green); animation: pulse 2s infinite; }
.dot.need_login, .dot.error { background: var(--red); }
.dot.paused, .dot.sleeping, .dot.maintenance { background: var(--gold); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(123, 209, 90, .55); } 70% { box-shadow: 0 0 0 7px rgba(123, 209, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(123, 209, 90, 0); } }

/* ============ герой ============ */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px 22px; margin-bottom: 18px; color: #fff;
  background: linear-gradient(125deg, #2f6e1c 0%, #418f24 45%, #6aae37 100%); box-shadow: 0 20px 44px -26px #4fa02c; border: 1px solid rgba(255,255,255,.08); }
.hero::before { content: ""; position: absolute; inset: auto -80px -160px auto; width: 380px; height: 380px; border-radius: 50%; background: rgba(255,255,255,.07); }
.hero-top { position: relative; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; z-index: 1; }
.hero-ava { width: 72px; height: 72px; border-radius: 22px; background: rgba(255,255,255,.22); padding: 3px; flex: none; position: relative; }
.hero-ava img { width: 100%; height: 100%; border-radius: 19px; object-fit: cover; background: #fff; }
.hero-ava .lvl { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); background: #ffcf3f; color: #5b3d00; font-weight: 900; font-size: 12px; padding: 1px 9px; border-radius: 99px; box-shadow: 0 2px 0 #c99000; white-space: nowrap; }
.hero-who { flex: 1; min-width: 220px; }
.hero-who h1 { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-who .sub { opacity: .92; font-weight: 700; margin-top: 2px; }
.xp { margin-top: 10px; max-width: 440px; }
.xp .track { height: 10px; border-radius: 99px; background: rgba(0,0,0,.22); overflow: hidden; }
.xp .track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ffe066, #ffbf1f); }
.xp small { display: flex; justify-content: space-between; opacity: .92; font-weight: 800; margin-top: 3px; font-size: 12px; gap: 10px; }
.hero-res { display: flex; gap: 10px; flex-wrap: wrap; }
.res { background: rgba(0,0,0,.16); border: 1px solid rgba(255,255,255,.18); border-radius: 16px; padding: 8px 14px; min-width: 112px; }
.res small { display: block; opacity: .85; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.res b { font-size: 20px; font-weight: 900; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res b img { width: 22px; height: 22px; }
.res .mini { height: 5px; border-radius: 9px; background: rgba(0,0,0,.25); margin-top: 5px; overflow: hidden; }
.res .mini i { display: block; height: 100%; background: #fff; border-radius: 9px; }
.hero-ctl { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.18); }
.hero-ctl .status { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; background: rgba(0,0,0,.22); padding: 6px 12px; border-radius: 99px; }
.hero-ctl .status .dot { border: 2px solid rgba(255,255,255,.7); }
.hero-ctl .msg { opacity: .92; font-weight: 700; }
.hero-ctl .sp { flex: 1; }
.hbtn { border: 0; border-radius: 12px; padding: 8px 14px; font-weight: 900; cursor: pointer; background: rgba(0,0,0,.2); color: #fff; display: inline-flex; gap: 6px; align-items: center; }
.hbtn:hover { background: rgba(0,0,0,.3); }
.hbtn.go { background: #fff; color: #2f6e1c; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.hbtn.stop { background: rgba(120, 20, 10, .45); }
.hero.off { background: linear-gradient(125deg, #2b332b, #3d473b); box-shadow: none; }
.hero.bad { background: linear-gradient(125deg, #7a2a1e, #b5523a); }
.hero.warn { background: linear-gradient(125deg, #7a5410, #b48224); }

.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.page-head .ic { width: 42px; height: 42px; border-radius: 13px; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 20px; flex: none; }
.page-head .ic img { width: 30px; height: 30px; object-fit: contain; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -.01em; }
.page-head p { margin: 0; color: var(--muted); font-weight: 700; font-size: 13px; }
.page-head .sp { flex: 1; }

/* ============ сітки й картки ============ */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.g5 { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.span { grid-column: 1 / -1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; background: var(--card-2); }
.card.hl { border-color: rgba(123, 209, 90, .55); box-shadow: 0 0 0 1px rgba(123, 209, 90, .25), var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 900; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-h .muted { font-size: 13px; }
.card-h .sp { flex: 1; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 46px 20px; text-align: center; font-weight: 800; }
.empty .big { font-size: 42px; display: block; margin-bottom: 8px; }
.section-title { font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }

.kpi { display: flex; gap: 12px; align-items: center; }
.kpi .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--card-2); flex: none; }
.kpi .ic img { width: 30px; height: 30px; object-fit: contain; }
.kpi .ic.g { background: var(--green-l); } .kpi .ic.y { background: var(--gold-l); } .kpi .ic.b { background: var(--blue-l); } .kpi .ic.v { background: var(--violet-l); } .kpi .ic.r { background: var(--red-l); }
.kpi small { color: var(--muted); font-weight: 800; font-size: 12px; display: block; }
.kpi b { font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; }
.kpi b.pos { color: var(--green); } .kpi b.neg { color: var(--red); }

/* «зараз» — швидкі плитки */
.now { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; }
.now-t { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; transition: border-color .15s, transform .1s; }
.now-t:hover { border-color: var(--line-2); transform: translateY(-1px); }
.now-t img { width: 42px; height: 42px; object-fit: contain; flex: none; }
.now-t b { display: block; font-weight: 900; }
.now-t small { color: var(--muted); font-weight: 700; font-size: 12px; }
.now-t .hot { color: var(--green); }

.bar { height: 8px; background: var(--card-3); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .6s; }
.bar.y i { background: var(--gold); } .bar.r i { background: var(--red); } .bar.b i { background: var(--blue); }

/* ============ кнопки, пілюлі ============ */
.btn { border: 1px solid var(--line-2); background: var(--card-2); border-radius: 12px; padding: 8px 14px; cursor: pointer; font-weight: 800; color: var(--ink); transition: background .15s, border-color .15s; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--muted); background: var(--card-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--green-d); border-color: var(--green-d); color: #0d1a08; box-shadow: 0 3px 0 #3c7d25; }
.btn.primary:hover { background: var(--green); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 10px; }
.btn.big { padding: 11px 18px; font-size: 15px; }
.btn.icon { padding: 6px 10px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--card-3); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--green-l); color: var(--green); } .pill.warn { background: var(--gold-l); color: var(--gold); } .pill.bad { background: var(--red-l); color: var(--red); } .pill.info { background: var(--blue-l); color: var(--blue); } .pill.v { background: var(--violet-l); color: var(--violet); }
.err { color: var(--red); font-size: 12px; font-weight: 800; }
.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; cursor: pointer; font-weight: 800; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--card-3); color: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }

.sw { position: relative; width: 42px; height: 24px; flex: none; display: inline-block; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw span { position: absolute; inset: 0; border-radius: 99px; background: var(--card-3); border: 1px solid var(--line-2); transition: background .2s; cursor: pointer; }
.sw span::after { content: ""; position: absolute; left: 3px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #cfd8c8; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .2s, background .2s; }
.sw input:checked + span { background: var(--green-d); border-color: var(--green-d); }
.sw input:checked + span::after { transform: translateX(17px); background: #fff; }

/* ============ модулі ============ */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.mod { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--card-2); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mod.off { opacity: .5; }
.mod-h { display: flex; align-items: center; gap: 10px; }
.mod-h .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--card-3); flex: none; font-size: 19px; }
.mod-h .ic img { width: 28px; height: 28px; object-fit: contain; }
.mod-h b { font-weight: 900; flex: 1; min-width: 0; }
.mod .when { font-size: 12px; font-weight: 800; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.mod .sum { font-size: 13px; color: var(--ink-2); min-height: 20px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 700; }
.mod.has-err { border-color: rgba(240, 112, 95, .5); }

/* ============ таблиці ============ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; position: sticky; top: 0; background: var(--card); }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--card-2); }
.scroll-x { overflow-x: auto; }
.pos { color: var(--green); font-weight: 900; } .neg { color: var(--red); font-weight: 900; }

/* ============ іконки предметів ============ */
.it { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; }
.it img, .it .em { width: 26px; height: 26px; object-fit: contain; flex: none; font-size: 19px; line-height: 26px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); font-weight: 800; font-size: 13px; }
.chip img, .chip .em { width: 22px; height: 22px; object-fit: contain; font-size: 16px; line-height: 22px; text-align: center; }
.chip.ok { background: var(--green-l); border-color: transparent; color: var(--green); } .chip.bad { background: var(--red-l); border-color: transparent; color: var(--red); } .chip.warn { background: var(--gold-l); border-color: transparent; color: var(--gold); }

/* ============ ферма ============ */
.field { display: grid; gap: 8px; padding: 14px; border-radius: 18px; background: linear-gradient(#2f4a1f, #263d19); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.tile { aspect-ratio: 1; border-radius: 12px; background: #7c5530; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.1); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; color: #fff; font-size: 11px; font-weight: 900; text-shadow: 0 1px 2px rgba(0,0,0,.6); overflow: hidden; }
.tile img { width: 62%; height: 62%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.tile .em { font-size: 24px; }
.tile .t { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; }
.tile .prog { position: absolute; left: 0; bottom: 0; height: 3px; background: #ffd84a; }
.tile.ready { box-shadow: inset 0 -4px 0 rgba(0,0,0,.25), 0 0 0 3px #ffd84a; }
.tile.wet { background: #5a3c20; }
.tile.dig { background: #9a7046; }
.tile.locked { background: rgba(0,0,0,.25); box-shadow: none; color: rgba(255,255,255,.55); }
.tile.buy { background: rgba(255,255,255,.06); border: 2px dashed rgba(255,255,255,.35); box-shadow: none; }
.tile .drop { position: absolute; top: 3px; right: 5px; font-size: 11px; }
.machines { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mach { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); font-weight: 800; font-size: 13px; }
.mach img { width: 34px; height: 34px; object-fit: contain; }
.mach small { color: var(--muted); display: block; font-size: 11px; }

/* ============ будівлі, загони, замовлення ============ */
.bld { display: flex; gap: 14px; align-items: flex-start; }
.bld-img { width: 84px; height: 84px; border-radius: 16px; background: var(--card-2); flex: none; display: grid; place-items: center; overflow: hidden; font-size: 36px; }
.bld-img img { width: 100%; height: 100%; object-fit: contain; }
.bld-body { flex: 1; min-width: 0; }
.bld-body h4 { margin: 0; font-size: 15px; font-weight: 900; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lvl-dots { display: flex; gap: 3px; margin: 6px 0; }
.lvl-dots i { width: 14px; height: 6px; border-radius: 4px; background: var(--card-3); }
.lvl-dots i.on { background: var(--green); }
.queue { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.job { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); font-size: 12px; font-weight: 800; }
.job .p { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--blue); }
.job.done { background: var(--green-l); border-color: transparent; color: var(--green); }
.job.free { border-style: dashed; color: var(--muted); }
.order { display: flex; gap: 14px; }
.npc { width: 62px; height: 62px; border-radius: 16px; background: var(--card-2); flex: none; overflow: hidden; }
.npc img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.reward { display: flex; gap: 12px; flex-wrap: wrap; font-weight: 900; margin-top: 8px; }
.reward span { display: inline-flex; gap: 4px; align-items: center; }
.reward img { width: 18px; height: 18px; }
.truck { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.truck img { width: 160px; max-width: 45%; }

/* ============ склад ============ */
.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.slot { position: relative; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); padding: 12px 8px 10px; text-align: center; }
.slot img, .slot .em { width: 48px; height: 48px; object-fit: contain; font-size: 34px; line-height: 48px; display: block; margin: 0 auto 4px; }
.slot .q { position: absolute; top: 6px; right: 8px; font-weight: 900; font-size: 12px; background: var(--card); padding: 0 7px; border-radius: 99px; border: 1px solid var(--line); }
.slot .nm { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .pr { color: var(--muted); font-size: 12px; font-weight: 700; }
.slot.need { border-color: rgba(242, 184, 75, .7); box-shadow: inset 0 0 0 1px rgba(242, 184, 75, .4); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filters button { border: 1px solid var(--line); background: var(--card-2); border-radius: 99px; padding: 5px 12px; font-weight: 800; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.filters button img { width: 18px; height: 18px; }
.filters button.on { background: var(--green-l); color: var(--green); border-color: rgba(123, 209, 90, .45); }

/* ============ план ============ */
.target { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.target .bld-img { width: 104px; height: 104px; }
.steps-v { display: grid; gap: 8px; }
.need-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--card-2); min-width: 0; max-width: 100%; }
.need-row > img, .need-row > .em { width: 32px; height: 32px; object-fit: contain; flex: none; font-size: 24px; line-height: 32px; text-align: center; }
.need-row > div { flex: 1; min-width: 0; }
.need-row > div > b { display: block; line-height: 1.25; overflow-wrap: anywhere; }
.need-row .q { margin-left: auto; flex: none; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--green); }
.plan-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.plan-cols .card { display: flex; flex-direction: column; }
.need-row small { color: var(--muted); display: block; font-size: 12px; font-weight: 700; }

/* ============ фінанси ============ */
.chart { width: 100%; height: 190px; display: block; }
.chart .gi-in { fill: var(--green); } .chart .gi-out { fill: var(--red); opacity: .85; }
.chart text { fill: var(--muted); font-size: 10px; font-weight: 700; }
.chart line { stroke: var(--line); }
.legend { display: flex; gap: 14px; font-size: 12px; font-weight: 800; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.catrow { display: grid; grid-template-columns: 30px minmax(110px, 1fr) 2fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.catrow:last-child { border-bottom: 0; }
.catrow .e { font-size: 18px; text-align: center; }
.catrow .bars { display: flex; flex-direction: column; gap: 3px; }
.catrow .bars i { display: block; height: 6px; border-radius: 6px; min-width: 2px; }
.catrow .bars .in { background: var(--green); } .catrow .bars .out { background: var(--red); }
.catrow .v { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }

/* ============ налаштування ============ */
.set-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.set-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.set-nav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 800; display: flex; gap: 8px; white-space: nowrap; }
.set-nav a:hover { background: var(--card); color: var(--ink); }
.set-sec { scroll-margin-top: 80px; }
.set-sec .desc { color: var(--muted); margin: -6px 0 14px; font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px 22px; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > label { font-weight: 800; font-size: 13px; }
.f .hint { color: var(--muted); font-size: 12px; font-weight: 700; }
.f.bool { flex-direction: row; align-items: flex-start; gap: 12px; padding: 6px 0; }
.f.bool label { font-weight: 800; cursor: pointer; }
.inp, .f input[type=text], .f input[type=number], .f input[type=password], .f select, .f textarea { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); width: 100%; font-weight: 700; }
.inp:focus, .f input:focus, .f select:focus, .f textarea:focus { outline: 2px solid rgba(123, 209, 90, .45); border-color: var(--green-d); }
.save-bar { position: sticky; bottom: 16px; margin-top: 16px; padding: 12px 16px; background: rgba(24, 34, 26, .92); backdrop-filter: blur(8px); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); display: flex; gap: 10px; justify-content: flex-end; align-items: center; z-index: 5; }
.save-bar .muted { margin-right: auto; }

/* ============ журнал ============ */
.log { font: 600 12.5px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; max-height: 68vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 6px 4px; }
.log.mini { max-height: 300px; }
.log .row { display: grid; grid-template-columns: 22px 64px 92px 1fr; gap: 8px; padding: 4px 10px; border-radius: 8px; align-items: start; }
.log .row:hover { background: var(--card); }
.log .lv { text-align: center; }
.log .t { color: var(--muted); }
.log .m { color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log .x { color: var(--ink-2); word-break: break-word; }
.log .l-ok .x { color: var(--ink); } .log .l-warn .x { color: var(--gold); } .log .l-error .x { color: var(--red); }
.log .day { padding: 8px 10px 4px; color: var(--muted); font-family: "Nunito", sans-serif; font-weight: 900; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.log-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.log-tools .inp { max-width: 260px; padding: 7px 12px; }

/* ============ вхід ============ */
.captcha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha img { height: 52px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.steps { padding-left: 20px; color: var(--ink-2); font-weight: 700; }
.steps li { margin-bottom: 6px; }
code { background: var(--card-3); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.callout { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 16px; background: var(--red-l); border: 1px solid rgba(240, 112, 95, .3); font-weight: 800; }
.callout .big { font-size: 26px; }
.callout.info { background: var(--blue-l); border-color: rgba(108, 182, 240, .3); }
.callout.warn { background: var(--gold-l); border-color: rgba(242, 184, 75, .3); }

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--card-2); border: 1px solid var(--line-2); border-left: 5px solid var(--green); border-radius: 14px; padding: 11px 16px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.7); max-width: 380px; font-weight: 800; animation: tin .25s ease-out; }
.toast.err { border-left-color: var(--red); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.gate-card { width: 340px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.gate-card h2 { margin: 0; font-weight: 900; }
.gate-ico { font-size: 48px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; z-index: 70; backdrop-filter: blur(3px); padding: 16px; }
.modal { width: min(460px, 100%); }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ============ мобільні елементи (сховані на ПК) ============ */
.mtop, .mbar, .scrim { display: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  /* шапка */
  .mtop { display: flex; position: sticky; top: 0; z-index: 25; height: calc(var(--top) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; align-items: center; gap: 10px;
    background: rgba(15, 21, 16, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .mtop-btn { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--card); display: grid; place-items: center; cursor: pointer; flex: none; }
  .burger { display: flex; flex-direction: column; gap: 4px; }
  .burger i { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
  .mtop-title { font-weight: 900; font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
  .mtop-res { display: flex; gap: 6px; }
  .mtop-res span { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 3px 9px 3px 5px; font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }
  .mtop-res img { width: 18px; height: 18px; }
  /* висувна панель зліва */
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: min(310px, 86vw); transform: translateX(-104%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 20px 0 50px rgba(0,0,0,.5); padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 50; }
  body.menu-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(4, 8, 4, .7); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 45; }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .side-close { display: grid; place-items: center; }
  .nav button { padding: 10px 12px; }
  /* нижня панель */
  .mbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; height: calc(var(--bar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(18, 26, 19, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .mbar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 800; color: var(--muted); cursor: pointer; position: relative; }
  .mbar button img, .mbar button .e { width: 26px; height: 26px; object-fit: contain; font-size: 20px; line-height: 26px; filter: grayscale(.6) brightness(.85); transition: filter .2s, transform .2s; }
  .mbar button.on { color: var(--green); }
  .mbar button.on img, .mbar button.on .e { filter: none; transform: translateY(-2px); }
  .mbar button.on::after { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }
  .main { padding: 14px 12px calc(var(--bar) + 24px + env(safe-area-inset-bottom)); }
  #toasts { left: 12px; right: 12px; bottom: calc(var(--bar) + 12px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  /* герой компактніше */
  .hero { padding: 16px; border-radius: 20px; }
  .hero-ava { width: 58px; height: 58px; border-radius: 18px; }
  .hero-ava img { border-radius: 15px; }
  .hero-who { min-width: 0; flex-basis: calc(100% - 80px); }
  .hero-who h1 { font-size: 20px; }
  .hero-res { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 8px; }
  .res { min-width: 0; padding: 7px 10px; }
  .res b { font-size: 16px; }
  .res b img { width: 18px; height: 18px; }
  .hero-ctl { gap: 6px; }
  .hero-ctl .msg { width: 100%; order: 5; font-size: 13px; }
  .hero-ctl .sp { display: none; }
  .hbtn { padding: 8px 11px; }
  .hbtn .lbl { display: none; }
  .hbtn.go .lbl, .hbtn.stop .lbl { display: inline; }
  .page-head .ic { width: 38px; height: 38px; }
  .page-head h2 { font-size: 18px; }
  .card { padding: 14px; border-radius: 16px; }
  .g2 { grid-template-columns: 1fr; }
  .set-layout { grid-template-columns: 1fr; }
  .set-nav { position: sticky; top: calc(var(--top) + 6px); z-index: 6; flex-direction: row; overflow-x: auto; background: rgba(15, 21, 16, .92); backdrop-filter: blur(8px); padding: 6px; border-radius: 14px; border: 1px solid var(--line); scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .save-bar { bottom: calc(var(--bar) + 10px + env(safe-area-inset-bottom)); }
  .save-bar .muted { display: none; }
  .log .row { grid-template-columns: 18px 56px 1fr; }
  .log .m { display: none; }
  .log { max-height: none; }
  .catrow { grid-template-columns: 26px 1fr auto; }
  .catrow .bars { grid-column: 2 / 4; grid-row: 2; }
  .order { flex-direction: column; }
  .npc { width: 52px; height: 52px; }
  .bld-img { width: 68px; height: 68px; }
  .inv { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .tbl th, .tbl td { padding: 8px 6px; }
  .truck img { max-width: 100%; width: 130px; }
}
