/* LinxPos Portal (from LinxPos Setup) - the colours are the web screen's; light first, dark when asked */
:root {
    --bg: #F5F6F9; --surface: #FFFFFF; --ink: #182031; --muted: #5B6478; --line: #DCE0E8;
    --accent: #3F6FD8; --accent-ink: #FFFFFF; --accent-soft: #E6EDFB;
    --ok: #2F8F5B; --warn: #B86E12; --danger: #B3372B; --bar: #1B2233; --bar-ink: #C9D2E6;
    --body: "Segoe UI", "Source Sans 3", system-ui, sans-serif; --mono: ui-monospace, "JetBrains Mono", Consolas, monospace;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121826; --surface: #1B2233; --ink: #E6EAF2; --muted: #9AA4B8; --line: #2C3548;
        --accent: #6E95F0; --accent-ink: #0E1320; --accent-soft: #233257; --ok: #5CC08A; --warn: #E3A24A; --danger: #EF7A6D;
        --bar: #0E1320; color-scheme: dark;
    }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); }
h1, h2, h3 { margin: 0; font-weight: 700; text-wrap: balance; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--ok); }
code, .mono { font-family: var(--mono); font-size: .9em; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.appbar { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--bar); color: #fff; flex-wrap: wrap; }
.appbar .brand { font-weight: 800; font-size: 17px; }
.appbar .site { font-size: 13px; background: rgba(255,255,255,.1); color: #fff; border: 0; padding: 5px 10px; border-radius: 14px; }
.appbar .site option { color: #000; }
.appbar .who { margin-left: auto; font-size: 13px; opacity: .85; }
.appbar .plain { color: #fff; }
.tabs { display: flex; gap: 2px; padding: 0 12px; background: var(--bar); overflow-x: auto; }
.tabs a { color: var(--bar-ink); text-decoration: none; font-weight: 600; padding: 10px 16px; border-radius: 8px 8px 0 0; white-space: nowrap; }
.tabs a.on { background: var(--bg); color: var(--ink); }
.content { padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1280px; width: 100%; }
.sub { display: flex; gap: 6px; flex-wrap: wrap; }
.sub a { font-weight: 600; font-size: 13.5px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 16px; padding: 5px 13px; text-decoration: none; }
.sub a.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* list on the left, the record on the right */
.md { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
@media (max-width: 800px) { .md { grid-template-columns: 1fr; } }
.list { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; max-height: calc(100vh - 170px); overflow-y: auto; }
.list button.item { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 7px 10px; font: inherit; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.list button.item:hover { background: var(--bg); }
.list button.item.on { background: var(--accent-soft); border-color: var(--line); }
.list small { color: var(--muted); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.list .search { margin-bottom: 6px; }
.list .new { margin-top: 6px; }
.list .heading { font: 700 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 2px; }

.form { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.form > h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { font: 600 11px var(--mono); padding: 3px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.group > h3 { font: 700 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field small { font-size: 12px; }
input, select, textarea { font: 15px var(--body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; }
textarea { font-family: var(--mono); font-size: 13px; }
input[type=color] { padding: 2px; height: 34px; width: 56px; }
input[type=number] { max-width: 110px; }
.money { display: flex; align-items: center; gap: 4px; } .money input { max-width: 130px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row .t { display: flex; flex-direction: column; }
.row .t span { font-size: 13px; color: var(--muted); }
.switch { width: 42px; height: 24px; border-radius: 12px; background: var(--line); border: 0; position: relative; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { left: 21px; }
@media (prefers-reduced-motion: reduce) { .switch::after { transition: none; } }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { font: 13px var(--body); padding: 5px 11px; color: var(--muted); background: var(--surface); border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips .t { background: var(--accent-soft); color: var(--accent); border-radius: 14px; padding: 3px 6px 3px 12px; display: inline-flex; align-items: center; gap: 4px; }
.chips .t button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 15px; padding: 0 4px; }
.btn { font: 600 14px var(--body); border-radius: 8px; padding: 7px 15px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.plain { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; padding: 4px 6px; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 600px) { .groups { grid-template-columns: 1fr; } }
.savebar { position: sticky; bottom: 0; background: var(--surface); padding-bottom: 4px; display: flex; gap: 10px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; flex-wrap: wrap; }
.savebar .note { margin-right: auto; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }

.signin { max-width: 400px; margin: 40px auto; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }

/* menus tree */
.tree { display: flex; flex-direction: column; gap: 3px; }
.node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.node.menu { background: var(--accent-soft); }
.node.on { outline: 2px solid var(--accent); }
.node.drop { border-style: dashed; border-color: var(--accent); }
.node .grip { color: var(--muted); cursor: grab; font-family: var(--mono); }
.node .kind { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.node .twist { width: 18px; text-align: center; color: var(--muted); border: 0; background: none; cursor: pointer; }

/* skin preview and zone editor */
.look { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .look { grid-template-columns: 1fr; } }
.canvas { position: relative; background: #0E1320; border-radius: 10px; overflow: hidden; width: 100%; }
.canvas .z { position: absolute; border: 2px solid; border-radius: 4px; font: 11px var(--body); padding: 2px 4px; overflow: hidden; cursor: move; }
.canvas .z.on { outline: 2px solid #fff; z-index: 2; }
.zones td, .zones th { padding: 3px 6px; font-size: 13px; text-align: left; }
.zones input { width: 70px; padding: 3px 5px; }
.swatch { display: flex; align-items: center; gap: 10px; }

/* keyboards and button bars */
.kbd { display: grid; gap: 4px; max-width: 100%; }
.kbd .key { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; overflow: hidden; min-height: 38px; padding: 2px; text-align: center; }
.kbd .key img { width: 100%; height: 100%; object-fit: fill; }
.kbd .key.on { outline: 2px solid var(--accent); background: var(--accent-soft); }
.kbd .empty { border: 1px dashed var(--line); border-radius: 6px; cursor: pointer; min-height: 38px; }
.bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 640px; }
.bar .slot { min-height: 54px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; font-size: 13px; padding: 4px; }
.bar .slot.used { background: #4169E1; color: #FFFDD0; font-weight: 700; }
.bar .slot.on { outline: 3px solid var(--warn); }
.bar .slot.dh { grid-row: span 2; }

/* settings list and history */
.setting { display: grid; grid-template-columns: 1fr minmax(160px, 320px); gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.setting .name { font-weight: 600; }
.setting .help { color: var(--muted); font-size: 13.5px; }
.setting .code { font: 11px var(--mono); color: var(--muted); }
.setting .val { grid-row: 1 / 4; grid-column: 2; display: flex; justify-content: flex-end; gap: 6px; align-items: center; }
.setting .val input, .setting .val select { width: 100%; }
@media (max-width: 700px) { .setting { grid-template-columns: 1fr; } .setting .val { grid-row: auto; grid-column: 1; justify-content: flex-start; } }
table.history { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.history th, table.history td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13.5px; vertical-align: top; }
table.history td.diff { font-family: var(--mono); font-size: 12px; max-width: 560px; overflow-wrap: anywhere; }
.scroll { overflow-x: auto; }

/* item menus: the tree, the product finder, tiles as the till shows them */
.im-tree { max-height: 420px; overflow-y: auto; }
.im-found { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; max-height: 300px; overflow-y: auto; }
.im-hit { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.im-hit.on { outline: 2px solid var(--accent); }
.im-hit img, .im-hit .im-nopic { width: 44px; height: 44px; object-fit: contain; flex: none; border-radius: 6px; background: #fff; }
.im-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.im-preview > div { cursor: pointer; }
.im-tile { width: 100%; max-width: 140px; height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px; border-radius: 10px; background: #fff; color: #14181F; border: 2px solid var(--line); font-weight: 700; font-size: 13px; text-align: center; }
.im-tile.folder { background: #E8EEFB; border-color: #3F6FD8; }
.im-tile img, .im-tile .im-nopic { width: 100%; height: 88px; object-fit: contain; }
.im-confirm { border: 1px solid var(--warn); border-radius: 8px; padding: 10px 12px; background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.im-preview { overflow-x: auto; }
.im-grid { display: grid; gap: 8px; }
.im-cell { min-height: 150px; border-radius: 10px; display: flex; align-items: stretch; justify-content: stretch; }
.im-cell.empty { border: 2px dashed var(--line); }
.im-cell .im-drag { width: 100%; cursor: grab; }
.im-cell .im-drag .im-tile { max-width: none; height: 146px; }

/* Receipt logo preview: a strip of receipt paper, an 80 mm roll's width of text */
.rcpt-paper { width: min(100%, 44ch); background: #fff; color: #111; border: 1px solid var(--line); border-radius: 4px;
              padding: 14px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 8px;
              box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.rcpt-paper img { image-rendering: pixelated; display: block; }
.rcpt-paper pre { font: 12px var(--mono); margin: 0; align-self: stretch; padding: 0 1ch; overflow: hidden; }

/* ---- the portal's own ---- */
.content.narrow { max-width: 520px; margin: 0 auto; }
.appbar .who small { opacity: .7; margin-left: 4px; }
.appbar a.plain { color: #fff; text-decoration: none; font-size: 13px; }
form.inline { display: inline; margin: 0; }
.signin .row { justify-content: flex-start; }
.notice { border: 1px solid var(--warn); background: var(--bg); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.big { font-size: 20px; letter-spacing: .04em; user-select: all; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.chip.warn { color: var(--warn); border-color: var(--warn); }
.chip.ok { color: var(--ok); border-color: var(--ok); }
.chip.danger { color: var(--danger); border-color: var(--danger); }
.search { min-width: 280px; }
table.grid { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.grid th, table.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13.5px; vertical-align: top; }
table.grid th { font: 700 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: var(--bg); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.card .n { font-size: 26px; font-weight: 800; }
.card:hover { border-color: var(--accent); }
@media (max-width: 700px) { .search { min-width: 0; width: 100%; } table.grid { display: block; overflow-x: auto; } }
