* { box-sizing: border-box; }
:root { --bg: #f1f5f9; --card: #fff; --line: #cbd5e1; --soft: #e2e8f0; --text: #0f172a; --mute: #64748b; --blue: #2563eb; --green: #15803d; --violet: #6d28d9; --amber: #d97706; --red: #dc2626; --dark: #1e293b; }
body { margin: 0; font-family: "Segoe UI", system-ui, Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 10px; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: var(--blue); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--mute); font-weight: 500; padding: 5px 4px; border-bottom: 1px solid var(--soft); position: sticky; top: 0; background: #fff; }
td { padding: 5px 4px; border-bottom: 1px solid var(--soft); vertical-align: top; }
.r { text-align: right; } .c { text-align: center; } .mute { color: var(--mute); } .small { font-size: 12px; } .b { font-weight: 600; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); } .violet { color: var(--violet); }
.strike td { color: #cbd5e1; text-decoration: line-through; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn-amber { background: var(--amber); border-color: var(--amber); color: #fff; font-weight: 600; }
.btn-dark { background: var(--dark); border-color: var(--dark); color: #fff; font-weight: 600; }
.btn-big { padding: 12px; font-size: 17px; border-radius: 8px; }
.link { border: 0; background: none; padding: 0; color: var(--blue); text-decoration: underline; }
.badge { display: inline-block; border-radius: 4px; padding: 0 5px; font-size: 11px; }
.badge.ok { background: #dcfce7; color: #166534; } .badge.no { background: #fee2e2; color: #b91c1c; } .badge.wait { background: #fef3c7; color: #92400e; } .badge.gray { background: #f1f5f9; color: #475569; }

/* layout */
.top { display: flex; align-items: center; gap: 12px; background: var(--dark); color: #fff; padding: 8px 14px; flex-wrap: wrap; }
.top .shop { font-size: 17px; font-weight: 700; margin-right: auto; }
.top .stat { text-align: right; line-height: 1.1; min-width: 90px; } .top .stat small { display: block; color: #94a3b8; font-size: 11px; } .top .stat b { font-size: 16px; }
.top button { background: transparent; color: #cbd5e1; border-color: #475569; }
.chip { border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; } .chip.open { background: #16a34a; } .chip.closed { background: #64748b; } .chip.stale { background: var(--red); }
.tabs { display: flex; gap: 2px; padding: 8px 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #fff; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 12px; color: var(--mute); }
.tabs button.on { color: var(--text); font-weight: 700; border-bottom-color: var(--blue); }
main { padding: 12px 14px; max-width: 1600px; margin: 0 auto; }
.pos { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; align-items: start; }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; } .grid5 { grid-template-columns: repeat(3, 1fr); } }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.tile { min-height: 70px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; padding: 8px; border-radius: 8px; }
.tile b { font-size: 14px; line-height: 1.15; } .tile span { font-size: 12px; opacity: .8; }
.tile.slate { background: #f8fafc; } .tile.blue { background: #eff6ff; border-color: #bfdbfe; } .tile.green { background: #f0fdf4; border-color: #bbf7d0; }
.tile.amber { background: #fffbeb; border-color: #fde68a; } .tile.rose { background: #fff1f2; border-color: #fecdd3; } .tile.violet { background: #f5f3ff; border-color: #ddd6fe; }
.tile:active { transform: scale(.97); }
.tile.custom { border-style: dashed; align-items: center; justify-content: center; color: var(--mute); }

/* cart */
.seg { display: grid; grid-auto-flow: column; gap: 6px; } .seg button { padding: 9px 4px; font-weight: 600; }
.seg button.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.seg.pay button.on[data-v=CASH] { background: var(--green); border-color: var(--green); } .seg.pay button.on[data-v=UPI] { background: var(--violet); border-color: var(--violet); }
.seg.pay button.on[data-v=BANK] { background: var(--blue); border-color: var(--blue); } .seg.pay button.on[data-v=CREDIT] { background: var(--amber); border-color: var(--amber); }
.cart { max-height: 330px; overflow: auto; margin: 8px 0; }
.line { border: 1px solid var(--soft); border-radius: 8px; padding: 6px; margin-bottom: 6px; }
.line input { padding: 4px 6px; }
.line .qty { width: 64px; text-align: center; } .line .rate { width: 80px; text-align: right; } .line .gst { width: 54px; text-align: right; }
.total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--soft); padding-top: 6px; }
.total b { font-size: 28px; }
.change { background: #dcfce7; color: #166534; border-radius: 6px; padding: 4px 8px; font-weight: 700; white-space: nowrap; }
.drop { position: relative; } .drop-list { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px #0002; max-height: 260px; overflow: auto; }
.drop-list button { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; } .drop-list button:hover { background: #f1f5f9; }
.scroll { max-height: 440px; overflow: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; } .stat-box small { color: var(--mute); display: block; font-size: 11px; } .stat-box b { font-size: 18px; }
.sumline { display: flex; justify-content: space-between; padding: 3px 0; } .sumline.tot { border-top: 1px solid var(--line); font-weight: 700; margin-top: 2px; padding-top: 5px; }
.notice { border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; } .notice.red { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; } .notice.green { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* login / start */
.center { max-width: 420px; margin: 8vh auto; }
.center h1 { margin: 0 0 4px; font-size: 22px; }

/* modal + toast */
#modal { position: fixed; inset: 0; background: #0f172a66; display: flex; align-items: center; justify-content: center; z-index: 50; padding: 12px; }
.modal-box { background: #fff; border-radius: 10px; width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--soft); } .modal-head .x { border: 0; font-size: 22px; padding: 0 6px; }
#modal-body { padding: 14px; overflow: auto; }
#toast { position: fixed; top: 12px; right: 12px; z-index: 60; display: flex; flex-direction: column; gap: 6px; }
.t { background: var(--dark); color: #fff; padding: 9px 14px; border-radius: 8px; box-shadow: 0 4px 12px #0003; max-width: 380px; } .t.err { background: var(--red); } .t.ok { background: var(--green); }
label.f { display: block; font-size: 12px; color: var(--mute); margin-bottom: 8px; } label.f input, label.f select, label.f textarea { margin-top: 3px; font-size: 14px; color: var(--text); }

/* job picker chips */
.chip-b { padding: 6px 10px; border-radius: 8px; text-align: left; line-height: 1.15; margin: 2px 0 8px; }
.chip-b small { display: block; color: var(--mute); font-size: 11px; }
.chip-b.on { background: var(--dark); border-color: var(--dark); color: #fff; } .chip-b.on small { color: #cbd5e1; }
.picker-opts b.small { display: block; margin-top: 4px; color: var(--mute); }
.tile span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* sticker sheet */
.sk { display: grid; grid-template-columns: minmax(380px, 5fr) 6fr; gap: 12px; align-items: start; }
@media (max-width: 1000px) { .sk { grid-template-columns: 1fr; } }
.sk-form > b { display: block; margin-top: 10px; }
.sk-prev svg { display: block; border-radius: 6px; }
.al3 { display: grid; grid-template-columns: repeat(3, 30px); gap: 3px; }
.al3 button { padding: 3px 0; } .al3 button.on, button.small.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.sk-scroll { max-height: 62vh; overflow: auto; border-radius: 6px; background: #e2e8f0; }
.sk-scroll svg { display: block; }
.sk-smooth { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 6px; }
@media (max-width: 700px) { .sk-smooth { grid-template-columns: 1fr; } }
.sk-trace { border: 1px solid var(--soft); border-radius: 8px; padding: 8px 10px; margin-top: 8px; background: #f8fafc; }
.sk-slider { display: grid; grid-template-columns: 130px 1fr 64px; gap: 4px 8px; align-items: center; margin-top: 6px; }
.sk-slider span { font-size: 13px; } .sk-slider input[type=range] { padding: 0; } .sk-slider input[type=number] { padding: 3px 6px; }
.sk-slider small { grid-column: 2 / -1; font-size: 11px; margin-top: -4px; }
.sk-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.sk-steps figure { margin: 0; text-align: center; } .sk-steps img { border: 1px solid var(--line); border-radius: 4px; background: #fff; max-width: 150px; display: block; }
.sk-steps figcaption { font-size: 11px; color: var(--mute); max-width: 150px; } .sk-steps .arrow { color: var(--mute); }
.sk-shape { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 4px 8px; }
.sk-shape svg { flex: none; }
.bg-ed { display: grid; grid-template-columns: 1fr 320px; gap: 12px; align-items: start; }
@media (max-width: 900px) { .bg-ed { grid-template-columns: 1fr; } }
.bg-canvas-wrap { background: repeating-conic-gradient(#e2e8f0 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; border: 1px solid var(--line); border-radius: 8px; display: flex; justify-content: center; align-items: center; min-height: 300px; }
#bg-cv { max-width: 100%; max-height: 68vh; touch-action: none; cursor: crosshair; display: block; }
.bg-row { display: grid; grid-template-columns: 1fr 120px 36px; gap: 6px; align-items: center; font-size: 12px; margin-top: 6px; } .bg-row input { padding: 0; }
.ex-row { display: grid; grid-template-columns: 80px 1fr; gap: 6px; align-items: center; margin-top: 4px; font-size: 13px; }
.cnt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
table.cnt input { padding: 3px 5px; width: 100%; } table.cnt td { padding: 2px 3px; }
.stat-box.amber-box { background: #fffbeb; border-color: #fde68a; }
.gang-row { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 5px; background: #fff; flex-wrap: wrap; }
.gang-row.ed { border-color: #f59e0b; box-shadow: 0 0 0 2px #fde68a; }
.gang-row img { width: 44px; height: 44px; object-fit: contain; background: repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0 / 8px 8px; border-radius: 4px; flex: none; }
.gang-row .grow { min-width: 120px; }
.pk-opt { display: block; border: 1px solid #e2e8f0; border-radius: 6px; padding: 7px 10px; margin-bottom: 6px; cursor: pointer; }
.pk-opt.on { border-color: #2563eb; background: #eff6ff; }

/* sticker step-by-step */
.sk-stepper { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px; }
.sk-st { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 10px; border: 1px solid transparent; background: transparent; border-radius: 8px; cursor: pointer; flex: 1; min-width: 120px; }
.sk-st b { display: block; font-size: 14px; } .sk-st small { display: block; font-size: 11px; color: #64748b; line-height: 1.2; }
.sk-st .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #e2e8f0; color: #334155; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sk-st.on { background: #eff6ff; border-color: #2563eb; } .sk-st.on .num { background: #2563eb; color: #fff; }
.sk-st.past .num { background: #16a34a; color: #fff; }
.sk-st-arrow { color: #cbd5e1; font-size: 20px; }
.sk-all { margin-left: auto; padding: 0 6px; white-space: nowrap; }
.sk-help { display: flex; gap: 10px; align-items: flex-start; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.sk-help-n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.sk-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #e2e8f0; }
.sk-nav button { padding: 9px 16px; font-size: 15px; }
.sk-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
.sk-actions button.big { padding: 9px 16px; font-size: 15px; }
.sk[data-step="1"] [data-st]:not([data-st~="1"]) { display: none !important; }
.sk[data-step="2"] [data-st]:not([data-st~="2"]) { display: none !important; }
.sk[data-step="3"] [data-st]:not([data-st~="3"]) { display: none !important; }
.sk[data-step="4"] [data-st]:not([data-st~="4"]) { display: none !important; }
.sk[data-step="5"] [data-st]:not([data-st~="5"]) { display: none !important; }
.sk[data-step="6"] [data-st]:not([data-st~="6"]) { display: none !important; }
.sk-side > .sk-actions { margin: 0 0 8px; background: #fffbeb; border-color: #fde68a; }
.pj-badge { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; padding: 6px 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; }
.pj-badge .small { margin-left: 0; } .pj-badge button:first-of-type { margin-left: auto; }
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }
.pj-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; background: #fff; }
.pj-thumb { width: 64px; height: 64px; flex: none; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0 / 8px 8px; border-radius: 6px; font-size: 28px; }
.pj-thumb img { max-width: 64px; max-height: 64px; }
.brand-box { display: flex; gap: 10px; align-items: center; margin: 8px 0 4px; }
.brand-img { width: 120px; height: 60px; flex: none; display: flex; align-items: center; justify-content: center; border: 1px dashed #cbd5e1; border-radius: 6px; background: repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0 / 8px 8px; }
.brand-img img { max-width: 116px; max-height: 56px; }

/* ================= Design system v2 — one height, one spacing, one colour set (build 23) =================
   Every button / box / dropdown is the same height and lines up; cards side by side end at the same line;
   one primary colour (blue) for the main action of each screen, green only for money coming in, amber for warnings. */
:root { --bg: #f3f5f8; --line: #d7dce4; --soft: #e8ecf1; --text: #111827; --mute: #64748b; --blue: #2563eb; --blue-d: #1d4ed8; --green: #15803d; --amber: #b45309; --red: #dc2626; --dark: #1e293b; --h: 38px; --r: 8px; --g: 12px; }
body { line-height: 1.45; background: var(--bg); }
button { min-height: var(--h); padding: 6px 14px; border-radius: var(--r); border-color: var(--line); font-weight: 500; line-height: 1.25; transition: background .12s, border-color .12s, box-shadow .12s; }
button:hover:not(:disabled) { border-color: #94a3b8; }
button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select { height: var(--h); padding: 0 10px; border-radius: var(--r); border-color: var(--line); }
textarea { border-radius: var(--r); border-color: var(--line); padding: 8px 10px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--blue); vertical-align: middle; }
.btn-blue:hover:not(:disabled) { background: var(--blue-d); border-color: var(--blue-d); }
.btn-dark:hover:not(:disabled) { background: #0f172a; }
.btn-big { min-height: 48px; font-size: 16px; font-weight: 700; padding: 10px 16px; }
button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.link, button.link { min-height: 0; padding: 0; border: 0; background: none; font-weight: 500; text-decoration: none; color: var(--blue); }
.link:hover { text-decoration: underline; }
td .link + .link, td .link + button, td button + .link { margin-left: 10px; }
.tabs button { min-height: 0; padding: 10px 14px; font-weight: 500; }
.top button { min-height: 32px; padding: 4px 12px; }
.modal-head .x { min-height: 0; }
.al3 button { min-height: 28px; padding: 3px 0; } .drop-list button { min-height: 36px; padding: 6px 10px; }
.sk-st { min-height: 0; } .sk-nav button, .sk-actions button.big { min-height: 40px; }
/* segmented choices: equal widths, same gap as the grids below them so columns line up */
.seg { gap: 8px; grid-auto-columns: 1fr; }
.grid2, .grid3, .grid4 { gap: 8px 10px; }
/* a choice in a grid (expense category …): soft blue when picked */
button.pick.on { background: #eff6ff; border-color: var(--blue); color: var(--blue-d); font-weight: 600; box-shadow: inset 0 0 0 1px var(--blue); }
/* cards */
.card { padding: 16px; border-color: var(--line); border-radius: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card > b:first-child { font-size: 15px; }
.pos { gap: var(--g); align-items: stretch; }
.col { display: flex; flex-direction: column; gap: var(--g); min-width: 0; }
.col > .card { margin: 0 !important; }
main > * + * { margin-top: var(--g); }
main > .stats { margin-bottom: 0; }
.stats { gap: 10px; }
.card .stats { margin-bottom: 12px; }
.stat-box { padding: 10px 12px; border-radius: var(--r); border-color: var(--line); min-height: 62px; display: flex; flex-direction: column; justify-content: center; }
.stat-box b { font-size: 19px; line-height: 1.25; }
/* forms: labels above boxes, boxes always full width of their column */
label.f { margin-bottom: 10px; font-weight: 500; }
label.f > input, label.f > select, label.f > textarea { display: block; width: 100% !important; margin-top: 4px; }
.row { gap: 10px; }
.row:has(> label.f) { align-items: flex-end; }
.row > label.f { margin-bottom: 0; }
/* one input line + its button (Add paper, Add machine …) */
.form-line { display: grid; gap: 8px; align-items: end; margin-top: 10px; }
.form-line.c4 { grid-template-columns: 1.4fr 1fr 1fr auto; } .form-line.c2 { grid-template-columns: 1fr auto; }
@media (max-width: 1440px) { .form-line.c4 { grid-template-columns: 1fr 1fr; } }
/* tables: text, buttons and boxes on one line in every row */
th { font-size: 12px; font-weight: 600; color: var(--mute); padding: 8px 6px; vertical-align: bottom; }
td { padding: 8px 6px; vertical-align: middle; }
tbody tr:hover td, table tr:hover > td { background: #f8fafc; }
.notice { border-radius: var(--r); }
.chip { padding: 3px 10px; }
@media (max-width: 1000px) { .pos[style*="grid-template-columns"] { grid-template-columns: 1fr !important; } }
td input:not([type=checkbox]):not([type=radio]) { padding: 0 8px; }
td input[type=number] { min-width: 72px; }
button { white-space: nowrap; }
.tile, .chip-b, .sk-st, .pk-opt, button.pick { white-space: normal; }
.chip-b.sk-view { white-space: nowrap; margin: 0; }
td.r, th.r { white-space: nowrap; }
@media (max-width: 700px) { .seg button, .grid2 button, .grid3 button, .grid4 button { white-space: normal; padding-left: 6px; padding-right: 6px; } main { padding: 10px; } .card { padding: 12px; } }
@media (max-width: 1000px) { .pos, .pos[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 700px) { main table { display: block; overflow-x: auto; } }

/* License Agreement dialog (first sign-in) */
.terms { display: flex; flex-direction: column; gap: 12px; }
.terms-ok { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; background: #F8FAFC; border: 1px solid var(--line, #E2E8F0); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.terms-ok input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.terms .row-end { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.login-legal { font-size: 12px; text-align: center; margin: 10px 0 0; color: #64748B; }
.terms-frame { width: 100%; height: min(48vh, 460px); border: 1px solid var(--line, #E2E8F0); border-radius: 8px; background: #fff; }
@media (max-width: 600px) { .terms-frame { height: 34vh; } .terms-ok { font-size: 13px; } }
