/* CPOS till — light by default, dark optional (the app always sets data-theme). System fonts so it works offline. */

:root,
[data-theme="dark"] {
	--bg: #070c18;
	--bg-2: #0b1324;
	--panel: #0f1a30;
	--panel-2: #142140;
	--line: rgba(255, 255, 255, .08);
	--line-2: rgba(255, 255, 255, .14);
	--text: #e8ecf4;
	--text-2: #aab3c5;
	--muted: #7d879b;
	/* Accent = the shop's industry colour (set by the app); gold by default. */
	--gold: var(--accent, #d4ae62);
	--gold-2: var(--accent-2, #f3d78e);
	--gold-ink: #120e06;
	--ok: #3fb68b;
	--warn: #e0a43a;
	--bad: #e5636b;
	--info: #5b8def;
	--shadow: 0 10px 30px rgba(0, 0, 0, .35);
	--radius: 12px;
	color-scheme: dark;
}

[data-theme="light"] {
	--bg: #f3f5f9;
	--bg-2: #ffffff;
	--panel: #ffffff;
	--panel-2: #f2f4f8;
	--line: rgba(10, 20, 40, .08);
	--line-2: rgba(10, 20, 40, .16);
	--text: #111827;
	--text-2: #3b4456;
	--muted: #6b7385;
	--gold: color-mix(in srgb, var(--accent, #c9a45c) 72%, #000);
	--gold-2: color-mix(in srgb, var(--accent, #c9a45c) 88%, #000);
	--gold-ink: #fff;
	--shadow: 0 10px 30px rgba(15, 25, 45, .12);
	color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
#print-frame { position: absolute; width: 0; height: 0; border: 0; visibility: hidden; }
.ic { flex: none; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.r { text-align: right; }
[hidden] { display: none !important; }

/* ---------- Boot & spinner ---------- */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--gold); animation: spin .8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons & inputs ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-2);
	background: var(--panel-2); color: var(--text); cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap;
	transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, color-mix(in srgb, var(--gold) 70%, #000)); color: var(--gold-ink); border-color: transparent; }
.btn--primary:hover { filter: brightness(1.06); }
.btn--soft { background: var(--panel-2); }
.btn--ghost { background: transparent; }
.btn--danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn--sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn--lg { min-height: 48px; padding: 10px 22px; font-size: 16px; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.link { background: none; border: 0; padding: 0; color: var(--gold); cursor: pointer; text-decoration: underline; }

input, select, textarea {
	width: 100%; min-height: 40px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line-2);
	background: var(--bg-2); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--gold); }
input[type="color"] { padding: 2px; height: 40px; }
.input-sm { min-height: 32px; padding: 4px 8px; width: 110px; }
textarea.input-sm { width: 100%; }
.filter-input { max-width: 320px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; grid-column: 1 / -1; }
.field--half { grid-column: auto; }
.field label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 4px 0 10px; grid-column: 1 / -1; }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.box legend { padding: 0 6px; font-weight: 700; color: var(--gold); }

/* ---------- Chips, badges, pills ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.chip {
	--chip: var(--gold);
	border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); border-radius: 999px;
	padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap;
}
.chip.is-active { background: color-mix(in srgb, var(--chip) 22%, transparent); border-color: var(--chip); color: var(--text); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; vertical-align: middle; }
.badge--ok { background: rgba(63, 182, 139, .16); color: var(--ok); }
.badge--warn { background: rgba(224, 164, 58, .16); color: var(--warn); }
.badge--bad { background: rgba(229, 99, 107, .16); color: var(--bad); }
.badge--info { background: rgba(91, 141, 239, .16); color: var(--info); }
.badge--muted { background: var(--panel-2); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--panel-2); color: var(--text-2); text-decoration: none; }
.pill--ok { color: var(--ok); }
.pill--warn { color: var(--warn); }
.pill--bad { color: var(--bad); background: rgba(229, 99, 107, .14); }
.pill--demo { color: var(--gold-2); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; overflow: auto; height: 100vh;
	background: radial-gradient(800px 500px at 15% 10%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(91, 141, 239, .12), transparent 60%), var(--bg); }
.login__card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); text-align: center; }
.brand { display: flex; align-items: center; gap: 12px; text-align: left; }
.brand b { display: block; font-size: 17px; }
.brand small { color: var(--muted); }
.login__card .brand { justify-content: center; margin-bottom: 18px; }
.login__label { color: var(--text-2); margin: 8px 0; }
.login__msg { color: var(--warn); }
.login__foot { font-size: 12px; margin-top: 14px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; height: 22px; margin: 8px 0 18px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); }
.pin-dots span.is-on { background: var(--gold); border-color: var(--gold); }
.pin-dots.is-shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pinpad__key { height: 60px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 22px; font-weight: 600; cursor: pointer; }
.pinpad__key:active { background: var(--line-2); }
.pinpad__key.is-ok { background: var(--gold); color: var(--gold-ink); font-size: 18px; }

.login--demo { align-items: start; }
.demo { width: min(1060px, 100%); padding: 10px 0 40px; }
.demo h1 { font-size: 18px; margin: 26px 0 12px; color: var(--gold-2); }
.demo__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.demo__card, .demo__role { text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.demo__card:hover, .demo__role:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.demo__card b, .demo__role b { font-size: 15px; }
.demo__card small, .demo__role small { color: var(--muted); }
.demo__card.is-active { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--panel)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.demo__roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.demo__role:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); height: 100vh; }
.side { background: var(--bg-2); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.side__brand b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.side__brand small { color: var(--muted); font-size: 12px; }
.side__nav { flex: 1; overflow: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.side__link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; border: 0; background: none; cursor: pointer; width: 100%; text-align: start; }
.side__link:hover { background: var(--panel); color: var(--text); }
.side__link.is-active { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 20%, transparent), color-mix(in srgb, var(--gold) 4%, transparent)); color: var(--gold-2); box-shadow: inset 3px 0 0 var(--gold); }
[data-theme="light"] .side__link.is-active { color: var(--gold); }
.side__foot { border-top: 1px solid var(--line); padding: 10px; }
.side__me { display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px; color: var(--text-2); }
.side__me b { display: block; color: var(--text); }
.side__me small { color: var(--muted); }
.side__scrim { display: none; }
.shell__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.topbar__menu { display: none; }
.topbar__info { flex: 1; display: flex; gap: 8px; }
.topbar__right { display: flex; gap: 8px; align-items: center; }
.banner { padding: 8px 16px; font-weight: 600; font-size: 13px; }
.banner--warn { background: rgba(224, 164, 58, .14); color: var(--warn); }
.banner--info { background: rgba(91, 141, 239, .12); color: var(--info); }
.main { flex: 1; min-height: 0; overflow: auto; }
.main--register { overflow: hidden; }

/* ---------- Pages ---------- */
.page { padding: 20px 24px 60px; max-width: 1400px; min-width: 0; }
.page__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page__head h1 { font-size: 22px; }
.page__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page__tools select, .page__tools input[type="date"] { width: auto; }
.section-title { margin: 24px 0 10px; font-size: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 16px; }
.card h2 { font-size: 15px; margin-bottom: 10px; }
.card--warn { border-color: rgba(224, 164, 58, .5); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.is-active { color: var(--gold-2); border-color: var(--gold); }
[data-theme="light"] .tab.is-active { color: var(--gold); }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; }
.search input { padding-inline-start: 40px; min-height: 46px; font-size: 15px; }
.search__ic { position: absolute; inset-inline-start: 12px; color: var(--muted); display: grid; }
.search--sm { flex: 0 1 280px; }
.search--sm input { min-height: 40px; font-size: 14px; }
.range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.range input { width: 150px; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel-2); }
.tbl th.r, .tbl td.r { text-align: end; }
.tbl tr.is-click { cursor: pointer; }
.tbl tr.is-click:hover td { background: var(--panel-2); }
.tbl tr.is-muted td { opacity: .5; }
.tbl small { color: var(--muted); }
.tbl--compact th, .tbl--compact td { padding: 6px 10px; }
.tbl tfoot td { font-weight: 600; }
.tbl .tot td { font-size: 15px; color: var(--gold-2); }
[data-theme="light"] .tbl .tot td { color: var(--gold); }
.pager { display: flex; gap: 8px; justify-content: center; }

.list { display: flex; flex-direction: column; gap: 6px; }
.list__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: start; cursor: pointer; width: 100%; }
.list__row:hover { border-color: var(--line-2); }
.list__row small { display: block; color: var(--muted); }
.list__row .ic { vertical-align: middle; margin-inline-end: 6px; }
.list__end { text-align: end; flex: none; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ic { color: var(--line-2); }
.empty.locked .ic { color: var(--gold); }
.empty .btn { margin-top: 10px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }

/* Stats & charts */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat b { font-size: 20px; }
.stat small { color: var(--muted); }
.stat--bad b { color: var(--bad); }
.stats--big .stat b { font-size: 24px; color: var(--gold-2); }
[data-theme="light"] .stats--big .stat b { color: var(--gold); }
.chart { display: flex; align-items: flex-end; height: 180px; gap: 4px; padding: 10px 0 22px; }
.chart__col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.chart__bar { width: 70%; max-width: 42px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.chart__lab { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); }
.meter { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: var(--panel-2); vertical-align: middle; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gold); }

.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.insight { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; border-top: 3px solid var(--info); }
.insight--good { border-top-color: var(--ok); }
.insight--warn { border-top-color: var(--warn); }
.insight h3 { font-size: 15px; margin-bottom: 6px; }
.insight__value { display: block; font-size: 26px; color: var(--gold-2); margin: 4px 0; }
.insight ul { list-style: none; padding: 0; margin: 8px 0 0; }
.insight li { display: grid; grid-template-columns: 1fr auto; padding: 5px 0; border-bottom: 1px solid var(--line); }
.insight li small { grid-column: 1 / -1; color: var(--muted); }
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.roles h3 { font-size: 14px; color: var(--gold-2); }
.roles ul { padding-inline-start: 18px; color: var(--text-2); font-size: 13px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 14px; }

/* ---------- Register ---------- */
.reg { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: 100%; min-height: 0; }
.reg__left { display: flex; flex-direction: column; min-height: 0; padding: 14px 16px 0; gap: 8px; }
.reg__bar { display: flex; gap: 8px; align-items: center; }
.reg__tools { display: flex; gap: 6px; }
.reg__tools .btn span { display: inline; }
#reg-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tiles { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: min-content; gap: 10px; padding: 4px 2px 20px; }
.tile {
	--tile: var(--gold);
	position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: start;
	min-height: 128px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
	box-shadow: inset 0 3px 0 var(--tile); transition: transform .08s, border-color .15s;
}
.tile:hover { border-color: var(--tile); }
.tile:active { transform: scale(.97); }
.tile img { width: 100%; height: 64px; object-fit: cover; border-radius: 8px; }
.tile__mono { display: grid; place-items: center; height: 46px; border-radius: 10px; background: color-mix(in srgb, var(--tile) 20%, transparent); color: var(--tile); font-weight: 800; font-size: 18px; letter-spacing: .05em; }
.tile__name { font-weight: 600; font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile__meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.tile__meta b { color: var(--gold-2); font-size: 14px; }
[data-theme="light"] .tile__meta b { color: var(--gold); }
.tile__stock { font-size: 11.5px; color: var(--muted); background: var(--panel-2); padding: 1px 6px; border-radius: 6px; }
.tile__stock.is-low { color: var(--warn); }
.tile__stock.is-out { color: var(--bad); }
.tile__tag { position: absolute; top: 8px; inset-inline-end: 8px; font-size: 10.5px; font-weight: 700; background: var(--panel-2); color: var(--text-2); padding: 2px 6px; border-radius: 6px; }

.reg__cart { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); border-inline-start: 1px solid var(--line); }
.cart__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.cart__head h2 { font-size: 17px; margin-bottom: 6px; }
.cust-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line-2); background: none; padding: 4px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 13px; max-width: 300px; }
.cust-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart__lines { list-style: none; margin: 0; padding: 6px 8px; flex: 1; overflow: auto; }
.cart__empty { flex: 1; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.cart__empty .ic { color: var(--line-2); }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 8px; border-radius: 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.cart-line:hover { background: var(--panel); }
.cart-line.is-flash { animation: flash .6s; }
@keyframes flash { from { background: color-mix(in srgb, var(--gold) 30%, transparent); } to { background: transparent; } }
.cart-line__name { font-weight: 600; display: block; }
.cart-line__qty { font-size: 12.5px; color: var(--muted); }
.cart-line__total { font-weight: 700; text-align: end; }
.cart-line__sub { grid-column: 1 / -1; font-size: 12px; color: var(--text-2); }
.cart-line__btns { grid-column: 1 / -1; display: flex; gap: 4px; justify-content: flex-end; opacity: 0; height: 0; overflow: hidden; transition: opacity .15s; }
.cart-line:hover .cart-line__btns, .cart-line:focus-within .cart-line__btns { opacity: 1; height: auto; }
.promo { color: var(--ok); }
.cart__totals { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cart__totals > div { display: flex; justify-content: space-between; color: var(--text-2); }
.cart__total { font-size: 20px; font-weight: 800; color: var(--text) !important; padding-top: 4px; }
.cart__actions { display: flex; gap: 6px; padding: 0 12px 8px; }
.cart__actions .btn { flex: 1; padding: 6px; font-size: 13px; }
.btn--pay { margin: 0 12px 12px; min-height: 60px; border-radius: 14px; border: 0; font-size: 20px; font-weight: 800; justify-content: space-between; padding: 0 22px; background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, color-mix(in srgb, var(--gold) 70%, #000)); color: var(--gold-ink); cursor: pointer; display: flex; align-items: center; }
.btn--pay:disabled { opacity: .4; cursor: not-allowed; }
.reg__mobile { display: none; }

/* Variant matrix, modifiers, tables */
.matrix-wrap { overflow: auto; }
.matrix { border-collapse: separate; border-spacing: 6px; }
.matrix th { font-weight: 700; color: var(--text-2); padding: 4px 8px; }
.matrix__cell { width: 84px; height: 60px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.matrix__cell:hover { border-color: var(--gold); }
.matrix__cell b { font-size: 17px; }
.matrix__cell small { color: var(--muted); }
.matrix__cell.is-out b { color: var(--bad); }
.matrix__na { text-align: center; color: var(--muted); }
.variant-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.variant { display: flex; flex-direction: column; padding: 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; text-align: start; }
.variant:hover { border-color: var(--gold); }
.variant small { color: var(--muted); }
.variant.is-out small { color: var(--bad); }
.mods { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; padding: 8px 12px; }
.mods legend { font-weight: 700; color: var(--gold-2); padding: 0 4px; }
.mod { display: flex; align-items: center; gap: 10px; padding: 8px 4px; cursor: pointer; }
.mod span { flex: 1; }
.mod em { color: var(--muted); font-style: normal; }
.serial-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.area { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.table-btn { height: 84px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.table-btn b { font-size: 18px; }
.table-btn small { color: var(--muted); }
.table-btn.is-busy { background: color-mix(in srgb, var(--gold) 18%, var(--panel)); border-color: var(--gold); }
.table-btn.is-busy small { color: var(--gold-2); }

/* Payment */
.pay__due { text-align: center; padding: 10px 0 14px; }
.pay__due span { display: block; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.pay__due b { font-size: 38px; color: var(--gold-2); }
[data-theme="light"] .pay__due b { color: var(--gold); }
.pay__due small { display: block; color: var(--muted); }
#pay-amt { font-size: 22px; text-align: center; min-height: 52px; }
.pay__methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.btn--method { min-height: 54px; font-size: 15px; }
.pay__list { list-style: none; padding: 0; margin: 0 0 8px; }
.pay__list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); margin-bottom: 4px; }
.pay__list li span { flex: 1; }
.done { text-align: center; padding: 10px 0; }
.done .ic { color: var(--ok); }
.done__no { color: var(--muted); }
.done__change { font-size: 18px; }
.done__change b { font-size: 34px; color: var(--gold-2); display: block; }

/* Item search inside forms */
.item-pick { position: relative; margin-bottom: 10px; }
.item-pick__res { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; max-height: 260px; overflow: auto; }

/* Appointments calendar */
.cal { --cols: 3; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.cal__head, .cal__row { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(160px, 1fr)); }
.cal__head { position: sticky; top: 0; background: var(--panel-2); z-index: 1; }
.cal__head span { padding: 10px; font-weight: 700; border-inline-start: 1px solid var(--line); }
.cal__row { min-height: 64px; border-top: 1px solid var(--line); }
.cal__time { padding: 6px 8px; color: var(--muted); font-size: 12px; }
.cal__cell { border-inline-start: 1px solid var(--line); padding: 3px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cal__cell:hover { background: var(--panel-2); }
.appt { text-align: start; border: 0; border-inline-start: 3px solid var(--info); background: rgba(91, 141, 239, .14); border-radius: 6px; padding: 5px 8px; cursor: pointer; min-height: calc(var(--len) * 56px); }
.appt b { display: block; font-size: 12.5px; }
.appt small { color: var(--text-2); font-size: 11.5px; }
.appt--arrived { border-color: var(--warn); background: rgba(224, 164, 58, .14); }
.appt--completed { border-color: var(--ok); background: rgba(63, 182, 139, .12); opacity: .75; }
.appt--cancelled, .appt--no_show { opacity: .4; text-decoration: line-through; }

/* Kitchen display */
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ticket { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; border-top: 4px solid var(--info); }
.ticket.is-late { border-top-color: var(--bad); }
.ticket.is-ready { border-top-color: var(--ok); }
.ticket header { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--panel-2); font-size: 16px; }
.ticket ul { list-style: none; margin: 0; padding: 6px; }
.ticket__line { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; font-size: 15px; }
.ticket__line:hover { background: var(--panel-2); }
.ticket__line small { grid-column: 2 / -1; color: var(--text-2); font-size: 12.5px; }
.ticket__line em { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--info); align-self: center; }
.ticket__line.is-preparing em { color: var(--warn); }
.ticket__line.is-ready { opacity: .65; }
.ticket__line.is-ready em { color: var(--ok); }
.ticket footer { padding: 8px 12px 12px; }

/* Customer display */
.is-display body { overflow: hidden; }
.cdisp { height: 100vh; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.cdisp__head { padding: 22px 30px; font-size: 26px; font-weight: 700; color: var(--gold-2); border-bottom: 1px solid var(--line); }
.cdisp__lines { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 10px 30px; font-size: 22px; }
.cdisp__lines li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cdisp__foot { display: flex; justify-content: space-between; padding: 24px 30px; font-size: 40px; font-weight: 800; background: var(--panel); }
.cdisp__foot b { color: var(--gold-2); }
.cdisp__thanks { position: absolute; inset: 0; background: var(--bg); display: grid; place-content: center; text-align: center; gap: 14px; }
.cdisp__thanks b { font-size: 60px; color: var(--gold-2); }
.cdisp__thanks span { font-size: 30px; }

/* ---------- Modals & toasts ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(2, 5, 12, .66); backdrop-filter: blur(2px); }
.modal__box { position: relative; width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); animation: pop .16s ease-out; }
.modal--wide .modal__box { width: min(860px, 100%); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 17px; }
.modal__body { padding: 16px 18px; overflow: auto; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
#toast-root { position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-inline-start: 4px solid var(--ok); box-shadow: var(--shadow); font-weight: 600; animation: pop .18s; transition: opacity .3s, transform .3s; }
.toast--error { border-inline-start-color: var(--bad); }
.toast--warn { border-inline-start-color: var(--warn); }
.toast.is-out { opacity: 0; transform: translateY(8px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.reg { grid-template-columns: minmax(0, 1fr) 340px; }
	.reg__tools .btn span { display: none; }
	.grid-2, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
	body { overflow: auto; }
	.shell { grid-template-columns: minmax(0, 1fr); }
	body { overflow-x: hidden; }
	.side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
	[dir="rtl"] .side { inset: 0 0 0 auto; transform: translateX(100%); }
	.shell.nav-open .side { transform: none; }
	.shell.nav-open .side__scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 39; }
	.topbar__menu { display: inline-grid; }
	.reg { grid-template-columns: minmax(0, 1fr); position: relative; }
	.reg__cart { display: none; }
	.reg.show-cart .reg__left { display: none; }
	.reg.show-cart .reg__cart { display: flex; }
	.reg__left, .reg__cart { padding-bottom: 60px; }
	.reg__mobile { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--bg-2); border-top: 1px solid var(--line); }
	.reg__mobile button { flex: 1; padding: 14px; border: 0; background: none; font-weight: 700; color: var(--text-2); }
	.reg__mobile button.is-active { color: var(--gold-2); box-shadow: inset 0 3px 0 var(--gold); }
	.reg__mobile b { background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 0 7px; margin-inline-start: 4px; }
	.tiles { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
	.page { padding: 14px 14px 60px; }
	.form-grid { grid-template-columns: 1fr; }
	.tbl { display: block; overflow-x: auto; white-space: nowrap; }
	.demo__roles { grid-template-columns: 1fr; }
	.dl { grid-template-columns: 110px 1fr; }
	.pill--demo { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- Industry personality ---------- */
.login { position: relative; }
.login__theme { position: absolute; top: 16px; inset-inline-end: 16px; border: 1px solid var(--line-2); background: var(--panel); }
.demo__card { --card: var(--gold); border-inline-start: 4px solid var(--card); position: relative; }
.demo__card:hover { border-color: var(--card); }
.demo__card.is-active { border-color: var(--card); background: color-mix(in srgb, var(--card) 16%, var(--panel)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--card) 30%, transparent); }
.demo__dot { position: absolute; top: 14px; inset-inline-end: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); }
.demo h1 { color: var(--gold-2); }
[data-theme="light"] .demo h1 { color: var(--gold); }

.ind-tool span { display: inline; }
.reg__tools { flex-wrap: wrap; justify-content: flex-end; }
.tbadges { display: flex; flex-wrap: wrap; gap: 3px; }
.tbadge { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--panel-2); color: var(--text-2); }
.tbadge--bad { background: rgba(229, 99, 107, .18); color: var(--bad); }
.tbadge--warn { background: rgba(224, 164, 58, .18); color: var(--warn); }
.tbadge--sizes { letter-spacing: .04em; }
.swatches { display: inline-flex; gap: 3px; align-items: center; }
.swatches i { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--line-2); display: inline-block; }

.seg { display: flex; margin: 8px 12px 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg__btn { flex: 1; padding: 7px 4px; border: 0; background: transparent; color: var(--text-2); font-weight: 700; cursor: pointer; font-size: 13px; }
.seg__btn + .seg__btn { border-inline-start: 1px solid var(--line-2); }
.seg__btn.is-active { background: var(--gold); color: var(--gold-ink); }
.acct { margin: 8px 12px 0; padding: 8px 10px; border-radius: 10px; background: var(--panel); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acct--empty { width: calc(100% - 24px); border: 1px dashed var(--gold); color: var(--gold-2); cursor: pointer; font-weight: 700; justify-content: center; }
[data-theme="light"] .acct--empty { color: var(--gold); }
.cart__note { margin: 8px 16px 0; font-size: 12.5px; color: var(--text-2); }
.cart__note--bad { color: var(--bad); }

.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; align-items: stretch; }
.strip__title { align-self: center; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-2); padding-inline-end: 4px; }
[data-theme="light"] .strip__title { color: var(--gold); }
.strip__item { flex: none; text-align: start; border: 1px solid var(--line-2); border-inline-start: 3px solid var(--gold); background: var(--panel); border-radius: 10px; padding: 6px 10px; cursor: pointer; display: flex; flex-direction: column; }
.strip__item small { color: var(--muted); font-size: 11.5px; }
.strip__item.is-here { border-inline-start-color: var(--ok); }

.qpad { text-align: center; }
.qpad__label { color: var(--muted); margin: 0 0 6px; }
.qpad__val { font-size: 34px; font-weight: 800; }
.qpad__price { font-size: 20px; color: var(--gold-2); margin-bottom: 14px; font-weight: 700; }
[data-theme="light"] .qpad__price { color: var(--gold); }
.qpad .pinpad { max-width: 320px; margin: 0 auto; }
