/* Výroba – Living Econic. Struktura podle vyroba.bmrc.cloud, paleta zelená. */
:root {
	--forest: #0c3b23;   /* tmavá – panel, nadpisy */
	--forest2: #14572f;  /* střední – gradient */
	--leaf: #51ba6b;     /* brandová zelená z loga Lifefood – POUZE dekorativně (na bílé má kontrast 2,45:1) */
	--green: #1c7a41;    /* interaktivní – odkazy, tlačítka (5,37:1 na bílé) */
	--green-hover: #15612f;
	--ink: #1f2733;
	--muted: #6b7480;
	--line: #e6e9ef;
	--bg: #f4f7f5;
	--radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
	color: var(--ink);
	background: var(--bg);
	line-height: 1.5;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--forest); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
	font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-hover); text-decoration: none; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--green); color: var(--green); text-decoration: none; }

/* ---------- Flash ---------- */
.flash { padding: .6rem 1rem; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.flash.success { background: #e7f7ee; color: #11633f; border: 1px solid #bfe8d2; }
.flash.error { background: #fdecec; color: #8a1f1f; border: 1px solid #f5c6c6; }
.flash.info { background: #eaf4ee; color: #14572f; border: 1px solid #c8e4d3; }

/* ---------- App shell (přihlášený) ---------- */
.topbar { background: linear-gradient(160deg, var(--forest) 0%, var(--forest2) 60%, var(--leaf) 150%); color: #fff; }
.topbar__in { max-width: 1660px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 12px; }
.topbar .logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 18px; }
.topbar .logo:hover { text-decoration: none; }
.topbar .logo img { height: 26px; width: auto; display: block; }
.topbar__spacer { flex: 1; }
.topbar__nav { display: flex; align-items: center; gap: 2px; }
.topbar__nav a { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 600; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.topbar__nav a:hover, .topbar__nav a.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.topbar__user { font-size: 13.5px; color: rgba(255,255,255,.85); display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.topbar__logout { color: #fff; border: 1px solid rgba(255,255,255,.35); padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.topbar__logout:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.container { max-width: 1320px; margin: 28px auto; padding: 0 24px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; }
.page-head .sub { color: var(--muted); font-size: 14px; }

/* ---------- Card ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(12,59,35,.06); overflow-x: auto; }
.card__body { padding: 24px; }

/* ---------- Tabulka ---------- */
table { border-collapse: collapse; width: 100%; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
thead th { background: #f5f9f6; color: var(--forest); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
tbody tr:last-child td { border-bottom: 0; }

/* Radek se skladovou kartou ma byt nizky - je jich na strance padesat. */
table.stock > tbody > tr.stock__row > td { padding: 5px 14px; line-height: 1.35; vertical-align: middle; }
.stock__row:hover { background: #f7fbf8; }
tbody tr.row-red { background: #fdecec; }
tbody tr.row-red:hover { background: #fbe0e0; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.rc { font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.dash { color: #b7c0b9; }
.empty { text-align: center; color: var(--muted); padding: 28px; }
/* externi kod a nazev od dodavatele, pripojene za nazev karty */
.ext-add { color: var(--muted); }
.col-toggle { width: 2.4rem; }
.col-code { width: 7.5rem; }
.col-extcode { width: 9rem; }
.col-unit { width: 8rem; }
.col-qty { width: 9rem; }

.tag { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }
.tag--ok { background: #e7f7ee; color: #11633f; border: 1px solid #bfe8d2; }

.toggle { width: 20px; height: 20px; line-height: 1; border: 1px solid var(--line); background: #fff; border-radius: 5px;
	cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; padding: 0; }
.toggle:hover { border-color: var(--green); color: var(--green); }

/* ---------- Razeni ---------- */
thead th.sortable { padding: 0; }
thead th.sortable > a { display: flex; align-items: center; gap: 6px; padding: 10px 14px; color: inherit; text-decoration: none; }
thead th.sortable.num > a { justify-content: flex-end; }
thead th.sortable > a:hover { background: #eaf3ec; text-decoration: none; }
thead th.sorted > a { color: var(--green); }
.sort-arrow { font-size: 10px; opacity: .35; }
thead th.sorted .sort-arrow { opacity: 1; }

/* ---------- Rozbalene jednotky (pres celou sirku radku) ---------- */
.stock__detail > td { background: #fbfdfb; padding: 0; border-bottom: 2px solid var(--line); }
table.units { width: 100%; margin: 0; table-layout: fixed; }
table.units th, table.units td { padding: 6px 14px; font-size: 13px; border-bottom: 1px solid #eef2ef; }
table.units tr:last-child td { border-bottom: 0; }
table.units thead th { background: transparent; color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 11.5px; }
table.units tr.unit-main td { font-weight: 600; }
table.units .u-unit { width: 14rem; }

/* ---------- Filtr + strankovani ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin-bottom: 18px; }
.filterbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.filterbar input[type=search] { padding: 9px 12px; width: 26rem; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); }
.filterbar__check { flex-direction: row; align-items: center; gap: 7px; padding-bottom: 10px; }
.btn--sm { padding: 6px 12px; font-size: 13px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0 40px; }
.pager__info { font-size: 13.5px; color: var(--muted); }
.pager__count { color: #9aa3ae; }

/* ---------- Login (dvoupanelová karta) ---------- */
body.plain { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding: 24px;
	background: radial-gradient(1200px 600px at 10% -10%, #e8f2ea 0%, #f4f7f5 45%, #eef2ef 100%); }
.login-card { width: min(960px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; background: #fff; border-radius: 22px;
	overflow: hidden; box-shadow: 0 30px 70px rgba(12,59,35,.18); }
.brand { position: relative; padding: 44px 40px; color: #fff; overflow: hidden;
	background: linear-gradient(160deg, var(--forest) 0%, var(--forest2) 55%, var(--leaf) 145%);
	display: flex; flex-direction: column; gap: 26px; }
/* align-self: flex-start – jinak by stretch v .brand roztáhl obrázek na plnou šířku */
.brand__logo { height: 44px; width: auto; display: block; align-self: flex-start; }
.brand__eyebrow { margin: 18px 0 0; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.72); }
.brand__title { color: #fff; margin: 8px 0 0; font-size: 29px; line-height: 1.15; }
.brand__lead { margin: 12px 0 0; font-size: 15px; color: rgba(255,255,255,.84); max-width: 38ch; }
.chips { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 12.5px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.20); color: rgba(255,255,255,.92); }

.login { padding: 48px 42px; display: flex; flex-direction: column; }
.login__inner { margin: auto 0; }
.login__title { margin: 0; font-size: 24px; }
.login__sub { margin: 8px 0 28px; font-size: 14.5px; color: var(--muted); }
.login__note { margin: 20px 0 0; font-size: 12.5px; color: var(--muted); }
.login__footer { margin: 30px 0 0; font-size: 12px; color: #9aa3ae; }

/* ---------- Pás značek skupiny (pod kartou) ---------- */
.group { width: min(960px, 100%); text-align: center; }
.group__label { margin: 0 0 16px; font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; color: #93a09a; }
.group__brands { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 30px; }
.group__brands img, .group__brands svg { width: auto; display: block; opacity: .72; transition: opacity .15s; }
.group__brands a:hover img, .group__brands a:hover svg { opacity: 1; }

/* Výšky jsou vyladěné opticky, ne mechanicky: odznaky (Zemanka, Puro shop)
   snesou víc výšky než široké wordmarky, jinak by je vizuálně přebily. */
.b-econea      { height: 15px; }
.b-lifefood    { height: 18px; }
.b-countrylife { height: 19px; }
.b-bionebio    { height: 21px; }
.b-zemanka     { height: 32px; }
.b-puroshop    { height: 34px; }

.ms-btn { display: inline-flex; align-items: center; gap: 12px; width: 100%; justify-content: center; padding: 0 18px; height: 48px;
	background: #fff; color: #3b3b3b; border: 1px solid #d2d6dc; border-radius: 10px; font-size: 15px; font-weight: 600; transition: .15s; }
.ms-btn:hover { border-color: var(--green); box-shadow: 0 6px 18px rgba(28,122,65,.15); text-decoration: none; }

@media (max-width: 820px) {
	.login-card { grid-template-columns: 1fr; }
	.brand { display: none; }
	.topbar__in { flex-wrap: wrap; height: auto; padding: 10px 14px; row-gap: 8px; }
	.topbar .logo { order: 1; }
	.topbar__spacer { order: 2; }
	.topbar__user { order: 3; }
	.topbar__nav { order: 4; width: 100%; overflow-x: auto; }
}
