/* Simple, clean styling that works from phone to desktop.
   No inline styles are used anywhere because the security policy (CSP) only
   allows styles from this file. */
/* Colours: these are the default (navy, gold and white). /theme.css replaces them with the company's own choice. */
:root{--t1:#f3f6fc;
  --t2:#e2eaf8;
  --t3:#cddbf4;
  --t4:#b1c9f1;
  --t5:#91b3ed;
  --t6:#6d9ae9;
  --t7:#4982e4;
  --t8:#286adc;
  --t9:#2159ba;
  --t10:#1d4b9a;
  --t11:#1a3d7a;
  --t12:#16315f;
  --t13:#112445;
  --t14:#0d182b;
  --header:#0b1f44;
  --primary:#14315f;
  --primary-dark:#0b1f44;
  --link:#1b4a9b;
  --accent:#c9a227;
  --accent-dark:#a3801a;
  --on-accent:#0b1f44;
  --tint:#eef2f9;
  --tint-line:#c9d4ea;
  --th:#e8edf6;
  --line:#dbe1ec;
  --page:#f7f8fb;
  --page2:#e6eaf2;
  --ring:#c9a227;}
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0; color: #1f2430; background: var(--page); -webkit-text-size-adjust: 100%; }
a { color: var(--link); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--header); color: #fff; }
.top a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 18px; }
.top nav { display: flex; gap: 6px 14px; flex: 1; flex-wrap: wrap; }
.top nav a { padding: 6px 2px; }
.top nav a:hover { text-decoration: underline; }
.who { opacity: .8; margin-right: 8px; font-size: 14px; word-break: break-all; }
form.inline { display: flex; align-items: center; flex-wrap: wrap; margin: 0; }
button.link { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font-size: 14px; padding: 6px 0; min-height: 0; }
main { max-width: 980px; margin: 20px auto; padding: 0 16px 60px; }
h1 { margin: 0 0 14px; font-size: 26px; }
h2 { font-size: 18px; margin: 22px 0 8px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0; }
.card.narrow { max-width: 460px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0; }
label { display: block; font-size: 14px; margin-bottom: 10px; font-weight: 600; }
label.check { font-weight: 400; }
input, select, textarea { display: block; width: 100%; padding: 10px 10px; margin-top: 4px; border: 1px solid #b9bfcb; border-radius: 6px; font: inherit; font-size: 16px; background: #fff; }
input[type=checkbox] { display: inline-block; width: auto; margin-right: 6px; }
.row label { flex: 1 1 200px; margin-bottom: 0; }
button, .button { display: inline-block; min-height: 42px; padding: 9px 14px; border: 1px solid #b9bfcb; border-radius: 6px; background: #fff; color: #1f2430; font: inherit; cursor: pointer; text-decoration: none; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.flash { background: var(--tint); border: 1px solid var(--tint-line); padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; word-break: break-word; }
.errors { background: #fdecec; border: 1px solid #f3b4b4; padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; color: #8a1c1c; }
.errors ul { margin: 0; padding-left: 18px; }
.hint { color: #667085; font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid #eceef2; text-align: left; vertical-align: top; }
.grid th { background: var(--th); font-size: 13px; white-space: nowrap; }
.grid .num { text-align: right; white-space: nowrap; }
.grid tr.grand td { font-weight: 700; border-top: 2px solid #1f2430; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.stat { flex: 1 1 150px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat .big { display: block; font-size: 24px; font-weight: 700; }
.badge.void { background: #b42318; color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 14px; vertical-align: middle; }
.logo-preview { max-width: 200px; max-height: 120px; display: block; margin: 8px 0; border: 1px solid var(--line); padding: 6px; background: #fff; }
.search { display: flex; gap: 8px; max-width: 420px; margin: 10px 0; }
.search input { margin-top: 0; }
.pager a { margin-right: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; font-size: 14px; }
.tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.convert { margin-bottom: 10px; }

/* ---- Document (print) page ---- */
.receipt-page { background: var(--page2); }
.receipt-actions { max-width: 720px; margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 0 16px; }
.receipt { max-width: 720px; margin: 16px auto; background: #fff; padding: 28px; border: 1px solid var(--line); }
.receipt-logo { max-width: 200px; max-height: 100px; display: block; margin-bottom: 10px; }
.receipt h1 { font-size: 22px; margin-bottom: 4px; }
.receipt h2 { margin-top: 18px; }
.receipt .addr { white-space: pre-line; margin: 0 0 12px; color: #444; }
.receipt .void-note { color: #b42318; font-weight: 700; font-size: 20px; }
.receipt .thanks { margin-top: 24px; color: #555; }

/* ---- Phones and small tablets ---- */
@media (max-width: 640px) {
  main { margin-top: 14px; }
  h1 { font-size: 22px; }
  .top nav { flex-basis: 100%; order: 3; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  .top nav a { padding: 8px 4px; }
  .receipt { padding: 16px; margin: 8px; }
  .grid th, .grid td { padding: 8px 6px; font-size: 14px; }
  button, .button { min-height: 46px; }
  .row label { flex-basis: 100%; }
  .grid .from { display: none; }      /* activity: hide the IP/device column on phones */
}

@media print {
  .no-print { display: none !important; }
  body, .receipt-page { background: #fff; }
  .receipt { border: 0; margin: 0; padding: 0; max-width: none; }
}

/* ---- version 3 additions ---- */
.badge.on { background: #067647; color: #fff; padding: 1px 7px; border-radius: 6px; font-size: 12px; vertical-align: middle; }
.nowrap { white-space: nowrap; }
.grid td form.inline-form { display: inline-flex; margin: 2px 4px 2px 0; }
.grid td form.inline-form button { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.grid select { margin-top: 0; min-width: 160px; }
.grid td input { margin-top: 0; }

/* ---- version 4 additions: insights ---- */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--primary); }
.chart .bar:hover { fill: var(--primary-dark); }
.chart .axis { font-size: 10px; fill: #667085; }
.chart .base { stroke: #b9bfcb; stroke-width: 1; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.up { color: #067647; font-weight: 600; }
.down { color: #b42318; font-weight: 600; }
tr.flag td { background: #fff4e5; }
.trace { white-space: pre-wrap; font-size: 12px; max-height: 260px; overflow: auto; background: var(--th); padding: 8px; }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } }

/* ---- version 5 additions: till (POS) ---- */
.pos-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 12px; background: var(--header); color: #fff; border-radius: 8px; margin-bottom: 10px; }
.pos-bar a { color: #fff; }
.pos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.pos-results { list-style: none; margin: 0; padding: 0; }
.pos-pick { width: 100%; text-align: left; margin-bottom: 6px; min-height: 52px; font-size: 16px; }
.pos-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 18px; margin: 8px 0; }
.pos-total { font-size: 22px; flex-basis: 100%; text-align: right; }
.pos-pay { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pos-method span { display: inline-block; padding: 12px 16px; border: 2px solid #b9bfcb; border-radius: 10px; background: #fff; min-width: 70px; text-align: center; cursor: pointer; }
.pos-method input { position: absolute; opacity: 0; pointer-events: none; }
.pos-method input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.pos-method input:focus-visible + span { outline: 3px solid var(--ring); }
.pos-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.pos-change { font-size: 18px; margin-bottom: 8px; }
.pos-change.big { font-size: 28px; }
button.qty { min-width: 40px; min-height: 40px; padding: 2px 8px; }
.pos-charge { width: 100%; min-height: 60px; font-size: 20px; margin: 6px 0; }
.pos-done { text-align: center; }
.pos-done .button { margin: 4px; }
.pos-empty td { color: #667085; }
@media (max-width: 800px) { .pos { grid-template-columns: 1fr; } }

/* ---- asset barcode labels ---- */
.barcode-img { display: block; max-width: 100%; height: 70px; background: #fff; border: 1px solid #ddd; }
#cam-video { width: 100%; max-width: 420px; border-radius: 8px; margin-top: .5rem; }
.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, 63mm); gap: 2mm; }
.label { width: 63mm; height: 33mm; border: 1px solid #999; padding: 2mm 3mm; box-sizing: border-box; overflow: hidden; page-break-inside: avoid; background: #fff; color: #000; }
.label-co { font-weight: 700; font-size: 8pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-name { font-size: 8pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label img { display: block; width: 100%; height: 14mm; margin: 1mm 0; }
.label-code { font-size: 7pt; text-align: center; font-family: monospace; }
@media print { .no-print, header.top, .flash { display: none !important; } main { padding: 0; } }

.label { display: flex; flex-direction: column; justify-content: center; }
.label img { height: 20mm; }

/* ---- offline banner ---- */
.net-banner { background: #fef3c7; color: #78350f; padding: .6rem 1rem; text-align: center; font-size: .95rem; }
.net-banner.off { background: #fde68a; }
.net-banner.bad { background: #fecaca; color: #7f1d1d; }
.net-banner a { color: inherit; font-weight: 600; }
.q-item { border: 1px solid #d1d5db; border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; background: #fff; }
.q-item.error { border-color: #dc2626; }

/* ---- version 6.7: themes ---- */
.top { border-bottom: 3px solid var(--accent); }
.brand { color: var(--accent) !important; }
.top nav a:hover { text-decoration-color: var(--accent); }
button:hover, .button:hover { border-color: var(--primary); }
button.primary:hover, .button.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
button.primary, .button.primary { box-shadow: inset 0 -2px 0 var(--accent); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }
h1 { border-left: 5px solid var(--accent); padding-left: 10px; }
.tabs a.on { box-shadow: inset 0 -2px 0 var(--accent); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.theme-pick { display: block; margin: 0; font-weight: 400; cursor: pointer; }
.theme-pick input { position: absolute; opacity: 0; pointer-events: none; }
.theme-pick .tile { display: block; border: 2px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.theme-pick input:checked + .tile { border-color: var(--primary); box-shadow: 0 0 0 2px var(--accent); }
.theme-pick input:focus-visible + .tile { outline: 3px solid var(--ring); }
.theme-pick .nm { display: block; font-size: 13px; margin-top: 4px; }
.sw { display: flex; height: 18px; border-radius: 4px; overflow: hidden; }
.sw i { flex: 1; display: block; }
.sw i:nth-child(1){background:var(--t1)} .sw i:nth-child(2){background:var(--t2)} .sw i:nth-child(3){background:var(--t3)}
.sw i:nth-child(4){background:var(--t4)} .sw i:nth-child(5){background:var(--t5)} .sw i:nth-child(6){background:var(--t6)}
.sw i:nth-child(7){background:var(--t7)} .sw i:nth-child(8){background:var(--t8)} .sw i:nth-child(9){background:var(--t9)}
.sw i:nth-child(10){background:var(--t10)} .sw i:nth-child(11){background:var(--t11)} .sw i:nth-child(12){background:var(--t12)}
.sw i:nth-child(13){background:var(--t13)} .sw i:nth-child(14){background:var(--t14)}
.sw.default i:nth-child(n+9){background:var(--accent)}
@media print { .top { border: 0; } }

/* ---- Zaikon badge: small and quiet, bottom right, never in the way of clicks or printing ---- */
.powered { position: fixed; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); width: 30px; height: auto; opacity: .5; pointer-events: none; z-index: 5; }
@media (max-width: 640px) { .powered { width: 24px; right: 8px; bottom: calc(6px + env(safe-area-inset-bottom)); opacity: .45; } }
@media print { .powered { display: none !important; } }
.test-banner { background: var(--accent); color: var(--on-accent); text-align: center; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.cred { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--th); padding: 2px 6px; border-radius: 4px; user-select: all; }
