/*
 * bistro.bmrc.cloud — firemní téma NAD Bootstrapem 5 (společný vizuální jazyk
 * portálu bmrc.cloud, převzatý z odměn). Barva sekce Podpora (#2563eb).
 * Zaměstnanci objednávají hlavně z telefonu, proto má objednávka velké
 * ovládací prvky a lištu se součtem přilepenou dole.
 */

:root {
	--primary: #2563eb;
	--primary-dark: #1d4ed8;
	--primary-soft: rgba(37, 99, 235, .10);
	--body: #212529;
	--muted: #6c757d;
	--border: #dee2e6;
	--border-soft: #e9ecef;
	--surface: #fff;
	--bg: #f5f6f8;
	--hover: #f8f9fa;
	--danger: #c0392b;
	--success: #2e7d32;
	--success-soft: rgba(46, 125, 50, .10);
	--kind-soup: #b45309;
	--kind-soup-bg: #fef3c7;
	--kind-main: #1d4ed8;
	--kind-main-bg: #dbeafe;
	--kind-extra: #6d28d9;
	--kind-extra-bg: #ede9fe;
	--radius: 8px;
	--radius-sm: 6px;
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
	--shadow: 0 .5rem 1rem rgba(16, 24, 40, .09);

	--bs-primary: #2563eb;
	--bs-primary-rgb: 37, 99, 235;
	--bs-link-color: #2563eb;
	--bs-link-color-rgb: 37, 99, 235;
	--bs-link-hover-color: #1d4ed8;
	--bs-border-radius: 8px;
	--bs-border-radius-sm: 6px;
}

body {
	min-height: 100vh;
	background: var(--bg);
	color: var(--body);
	font-size: 14px;
	-webkit-font-smoothing: antialiased;
}

/* ── Bootstrapí modrá → firemní ──────────────────────── */
.btn-primary {
	--bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
	--bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark);
	--bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark);
}
.btn-outline-primary {
	--bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary);
	--bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary);
	--bs-btn-active-bg: var(--primary); --bs-btn-active-border-color: var(--primary);
}
.text-bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem var(--primary-soft); }
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-xs { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .45rem; --bs-btn-font-size: .75rem; border-radius: 5px; }

.card { border-radius: var(--radius); background: var(--surface); }
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.form-control, .form-select { border-radius: var(--radius-sm); }
.form-label { font-weight: 600; margin-bottom: .3rem; font-size: .85rem; }
.checkrow { display: flex; flex-wrap: wrap; gap: .1rem 1rem; padding-top: .35rem; }
.checkrow .form-check { margin-right: 0; }
.text-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.nowrap { white-space: nowrap; }

.table > :not(caption) > * > * { padding: .45rem .6rem; }
.table thead th {
	font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;
	color: var(--muted); font-weight: 600; background: var(--surface);
	border-bottom: 2px solid var(--border); white-space: nowrap;
}
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.tablewrap > table { margin-bottom: 0; }
.row-muted td { opacity: .6; }
.row-daystart > td { border-top: 2px solid var(--border); }
.section-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 22px 0 8px; }

.badge { font-weight: 600; }
.flash-wrap { position: sticky; top: .75rem; z-index: 1030; }
.alert { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.kpirow { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.kpi { flex: 1 1 150px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.kpi__label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.kpi__value { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.errorpage { max-width: 560px; margin: 3rem auto; text-align: center; }


/* ════════════════════════════════════════════════════════
   Tmavý levý sidebar + horní lišta
   ════════════════════════════════════════════════════════ */
:root {
	--sidebar-w: 224px;
	--sb-bg: #111827; --sb-hover: #1f2937; --sb-fg: #e5e7eb; --sb-muted: #9ca3af; --sb-border: #1f2937;
}
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--sb-bg); color: var(--sb-fg); display: flex; flex-direction: column; z-index: 1040; }
.sidebar__top { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--sb-border); }
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 6px; text-decoration: none; flex: 1; min-width: 0; }
.sidebar__brand span { font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.brandmark { display: block; border-radius: 7px; flex: none; }
.sidebar__toggle { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--sb-muted); cursor: pointer; }
.sidebar__toggle:hover { background: var(--sb-hover); color: var(--sb-fg); }
.sidebar__toggle svg { transition: transform .18s; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; flex: 1; }
.sidebar__nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 6px; font-weight: 500; color: var(--sb-muted); text-decoration: none; }
.sidebar__nav a:hover { background: var(--sb-hover); color: var(--sb-fg); }
.sidebar__nav a.active { background: var(--primary); color: #fff; }
.sidebar__nav .ico { flex: none; }
.sidebar__user { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-top: 1px solid var(--sb-border); }
.sidebar__who { line-height: 1.3; min-width: 0; }
.sidebar__who strong { display: block; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__who small { display: block; font-size: 11.5px; color: var(--sb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__who a { font-size: 12px; color: var(--sb-muted); }
.sidebar__who a:hover { color: var(--sb-fg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 auto; }

.sidebar-collapsed { --sidebar-w: 64px; }
.sidebar-collapsed .sidebar__brand span, .sidebar-collapsed .sidebar__nav a span, .sidebar-collapsed .sidebar__who { display: none; }
.sidebar-collapsed .sidebar__top { flex-direction: column; gap: 8px; padding: 12px 0; }
.sidebar-collapsed .sidebar__brand { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar__nav { padding: 12px 8px; }
.sidebar-collapsed .sidebar__nav a { justify-content: center; padding: 9px 0; }
.sidebar-collapsed .sidebar__user { justify-content: center; padding: 14px 0; }
.sidebar-collapsed .sidebar__toggle svg { transform: rotate(180deg); }

.main { min-height: 100vh; }
body.has-sidebar .main { margin-left: var(--sidebar-w); transition: margin-left .18s; }
.content { max-width: 1400px; margin: 0 auto; padding: 20px 20px 48px; }
.page-head { margin-bottom: 16px; }

.topbar { position: sticky; top: 0; z-index: 1035; background: var(--sb-bg); padding: 10px 18px; display: flex; align-items: center; gap: 12px; }
.topbar__spacer { flex: 1 1 auto; }
.langswitch { display: flex; align-items: center; gap: 6px; }
.langswitch__btn { display: inline-flex; align-items: center; padding: 5px; border-radius: 6px; line-height: 0; opacity: .55; transition: opacity .12s, background .12s; }
.langswitch__btn:hover { opacity: 1; background: var(--sb-hover); }
.langswitch__btn.active { opacity: 1; background: var(--sb-hover); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.topbar__logout { display: none; width: 34px; height: 34px; place-items: center; border-radius: 8px; color: #cbd5e1; }
.topbar__logout:hover { background: var(--sb-hover); color: #fff; }

@media (max-width: 768px) {
	.sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
	.sidebar__top { border-bottom: 0; }
	.sidebar__toggle, .sidebar__user { display: none; }
	.sidebar__nav { flex-direction: row; flex-wrap: wrap; padding: 0 8px 8px; gap: 2px; flex: 1 1 100%; }
	.sidebar__nav a { padding: 8px 10px; }
	body.has-sidebar .main { margin-left: 0; }
	.content { padding: 14px 12px 32px; }
	.topbar { padding: 8px 12px; }
	.topbar__logout { display: grid; }
}


/* ════════════════════════════════════════════════════════
   Přihlášení
   ════════════════════════════════════════════════════════ */
.signbox { max-width: 440px; margin: 28px auto 0; }
.signlinks { display: flex; justify-content: center; gap: 10px; margin-top: 14px; font-size: 13px; }
.signlinks a { color: var(--muted); }
.pn-input { font-size: 1.8rem; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.signdivider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted); font-size: 12px; }
.signdivider::before, .signdivider::after { content: ''; flex: 1; border-top: 1px solid var(--border); }


/* ════════════════════════════════════════════════════════
   Týden, dny a jídla
   ════════════════════════════════════════════════════════ */
.weeknav { display: flex; align-items: center; gap: 6px; }
.weeknav__label { font-weight: 600; min-width: 120px; text-align: center; white-space: nowrap; }

.kind { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.kind--soup { background: var(--kind-soup-bg); color: var(--kind-soup); }
.kind--main { background: var(--kind-main-bg); color: var(--kind-main); }
.kind--extra { background: var(--kind-extra-bg); color: var(--kind-extra); }

.daygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.daycard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 12px 14px; }
.daycard.is-today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.daycard.is-locked .menuitem { opacity: .72; }
.daycard__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.daycard__title strong { font-size: 15px; margin-right: 6px; }
.daycard__title span { color: var(--muted); }
.daycard__note { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.deadline { font-size: 12px; color: var(--success); font-weight: 600; white-space: nowrap; }

.menulist { list-style: none; margin: 0; padding: 0; }
.menuitem { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border-soft); }
.menuitem:first-child { border-top: 0; }
.menuitem.has-qty .menuitem__name { font-weight: 600; }
.menuitem__text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.menuitem__name { flex: 1 1 100%; line-height: 1.3; }
.menuitem__price { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.qty { display: flex; align-items: center; flex: none; }
.qty__btn { width: 38px; height: 38px; border: 1px solid var(--border); background: var(--surface); color: var(--body); font-size: 20px; line-height: 1; cursor: pointer; }
.qty__btn:first-child { border-radius: 8px 0 0 8px; }
.qty__btn:last-child { border-radius: 0 8px 8px 0; }
.qty__btn:hover { background: var(--hover); color: var(--primary); }
.qty__input { width: 44px; height: 38px; border: 1px solid var(--border); border-left: 0; border-right: 0; text-align: center; font-size: 16px; font-weight: 600; background: var(--surface); color: var(--body); -moz-appearance: textfield; }
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty__input:disabled { border: 1px solid var(--border-soft); border-radius: 8px; background: transparent; color: var(--muted); }
.has-qty .qty__input { color: var(--primary); }

.sumbar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(16, 24, 40, .08); }
.sumbar__sum { font-size: 15px; }
.sumbar__sum strong { font-size: 19px; font-variant-numeric: tabular-nums; }

.qrbox { background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); line-height: 0; }
.qrbox img { display: block; }

/* výdej */
.portions { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.portion { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.portion .kind { justify-self: start; }
.portion__name { grid-column: 1; }
.portion__num { grid-column: 2; grid-row: 1 / span 2; font-size: 22px; font-variant-numeric: tabular-nums; }
.portion small { grid-column: 1 / -1; }
.portion.is-zero { opacity: .55; }
.servetable tr.is-served > td { background: var(--success-soft); }
.servetable form { margin: 0; }

/* jídelníček (obsluha) */
.menurows { display: flex; flex-direction: column; gap: 6px; }
.menurow { display: grid; grid-template-columns: 140px minmax(180px, 2fr) minmax(150px, 1.4fr) 100px 60px; gap: 6px; align-items: center; }
.menurow--head { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.menurow--new .form-control, .menurow--new .form-select { border-style: dashed; }
.menurow__del { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; cursor: pointer; }
/* telefon: název a anglický název přes celou šířku, druh a cena vedle sebe */
@media (max-width: 767.98px) {
	.menurow { grid-template-columns: 1fr 110px; padding: 8px 0; border-top: 1px solid var(--border-soft); }
	.menurow--head { display: none; }
	.menurow > :nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
	.menurow > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
	.menurow > :nth-child(1) { grid-column: 1; grid-row: 3; }
	.menurow > :nth-child(4) { grid-column: 2; grid-row: 3; }
	.menurow > :nth-child(5) { grid-column: 1 / -1; grid-row: 4; }
	.menurow__del { justify-content: flex-start; }
	.menurow--new > :nth-child(5) { display: none; }
}

/* řazení výpisu */
.sortlink { color: inherit; text-decoration: none; }
.sortlink:hover { color: var(--primary); }
.sortlink.is-asc::after { content: ' \25B2'; font-size: 9px; color: var(--primary); }
.sortlink.is-desc::after { content: ' \25BC'; font-size: 9px; color: var(--primary); }


/* ── Dvouzáložkový filtr „Omezení / Výpis“ (stejně jako na reklamacích) ── */
.tabs2 { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab2 { padding: 9px 16px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab2:hover { color: var(--body); text-decoration: none; }
.tab2.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.pill-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.filter--rows { max-width: 760px; }
.frow { display: flex; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.frow:last-of-type { border-bottom: 0; }
.frow__label { flex: 0 0 150px; padding-top: 8px; font-size: 13px; font-weight: 600; }
.frow__control { flex: 1; min-width: 0; }
.frow__control--inline { display: flex; align-items: center; gap: 8px; }
.frow__control--inline .form-control { max-width: 200px; }
.frow__sep { color: var(--muted); }
@media (max-width: 575.98px) {
	.frow { flex-direction: column; gap: 4px; }
	.frow__label { flex: none; padding-top: 0; }
}


/* ── Přepínač motivu ─────────────────────────────────────────────────── */
.theme-toggle {
	position: relative; width: 34px; height: 34px; flex: none;
	display: grid; place-items: center; padding: 0;
	border: 1px solid var(--sb-hover); border-radius: 8px;
	background: rgba(255, 255, 255, .06); color: #cbd5e1; cursor: pointer;
}
.theme-toggle:hover { color: #fff; border-color: var(--primary); }
.theme-toggle__mode { position: absolute; right: 2px; bottom: 1px; font-size: 9px; font-weight: 700; line-height: 1; color: #93c5fd; }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }


/* ── Přepínač aplikací bmrc.cloud ────────────────────────────────────── */
.appswitch { flex: none; }
.appswitch__btn {
	width: 34px; height: 34px; display: grid; place-items: center;
	border: 1px solid var(--sb-hover); border-radius: 8px;
	background: rgba(255, 255, 255, .06); color: #cbd5e1; cursor: pointer; padding: 0;
}
.appswitch__btn:hover, .appswitch__btn[aria-expanded="true"] { color: #fff; border-color: var(--primary); background: rgba(255, 255, 255, .12); }
.appswitch__menu { min-width: 320px; padding: 8px; border-radius: 10px; box-shadow: var(--shadow); }
.appswitch__portal { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--body); }
.appswitch__portal:hover { background: var(--hover); color: var(--body); }
.appswitch__portal-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.appswitch__portal small { display: block; color: var(--muted); font-size: 11.5px; }
.appswitch__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.appswitch__tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 8px; text-decoration: none; color: var(--body); text-align: center; }
.appswitch__tile:hover { background: var(--hover); color: var(--body); }
.appswitch__tile.is-current { background: var(--primary-soft); pointer-events: none; }
.appswitch__ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #fff; font-size: 16px; line-height: 1; }
.appswitch__ico--logo { background: transparent; }
.appswitch__ico img { display: block; object-fit: contain; }
.appswitch__name { font-size: 11.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.appswitch__label { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 6px 2px; }
.appswitch__freq + .appswitch__all { margin-top: 4px; border-top: 1px solid var(--border-soft); }
@media (max-width: 768px) {
	.appswitch__menu { min-width: 260px; }
	.appswitch__grid { grid-template-columns: repeat(2, 1fr); }
}


/* ── Tmavý režim ─────────────────────────────────────────────────────────
   Bootstrap 5.3 si komponenty přebarví sám podle data-bs-theme; tady jen
   naše tokeny. Sidebar a horní lišta jsou tmavé v obou režimech. */
:root[data-theme="dark"] {
	--body: #e6eaf0;
	--muted: #9aa4b2;
	--border: #2c343f;
	--border-soft: #222933;
	--surface: #171d25;
	--bg: #0f141a;
	--hover: #1b222b;
	--danger: #f1707a;
	--success: #6cc48f;
	--success-soft: rgba(108, 196, 143, .12);
	--primary-soft: rgba(96, 145, 245, .16);
	--kind-soup: #f3c06b;
	--kind-soup-bg: rgba(217, 119, 6, .18);
	--kind-main: #8ab4f8;
	--kind-main-bg: rgba(59, 130, 246, .18);
	--kind-extra: #c4b5fd;
	--kind-extra-bg: rgba(139, 92, 246, .18);
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
	--shadow: 0 .5rem 1rem rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--body: #e6eaf0;
		--muted: #9aa4b2;
		--border: #2c343f;
		--border-soft: #222933;
		--surface: #171d25;
		--bg: #0f141a;
		--hover: #1b222b;
		--danger: #f1707a;
		--success: #6cc48f;
		--success-soft: rgba(108, 196, 143, .12);
		--primary-soft: rgba(96, 145, 245, .16);
		--kind-soup: #f3c06b;
		--kind-soup-bg: rgba(217, 119, 6, .18);
		--kind-main: #8ab4f8;
		--kind-main-bg: rgba(59, 130, 246, .18);
		--kind-extra: #c4b5fd;
		--kind-extra-bg: rgba(139, 92, 246, .18);
		--shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
		--shadow: 0 .5rem 1rem rgba(0, 0, 0, .5);
	}
}
:root[data-theme="dark"] .sumbar { box-shadow: 0 -4px 16px rgba(0, 0, 0, .5); }
