/* 🧭 Company program: the consolidated menu (js/cnav.js) — a slim rail of parents on a computer, a sticky footer on a phone, the
   parent pop-ups, Home's parent boxes — and the modern look of lists: tables as cards on a phone, roomy tables with a sticky header
   on a computer. The same look as the group portal (group/css/gnav.css). Colours come from the design tokens (tokens.css → ds.css). */

/* ---------- the rail (over 900 px) ---------- */
body.cn-on #side { width: 92px; padding: 8px 6px; gap: 4px; align-items: stretch; overflow-y: auto; scrollbar-width: thin; }
body.cn-on #side .cn-r { flex-direction: column; justify-content: center; gap: 3px; min-height: 60px; padding: 7px 4px; border-radius: 14px; text-align: center; color: var(--ink); }
body.cn-on #side .cn-r .ic { font-size: 1.3rem; line-height: 1; display: inline-grid; place-items: center; width: 40px; height: 30px; border-radius: 999px; transition: background var(--ds-dur-1, .12s); }
body.cn-on #side .cn-r .lb { font-size: .72rem; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; max-width: 100%; }
body.cn-on #side .cn-r:hover { background: transparent; } body.cn-on #side .cn-r:hover .ic { background: var(--soft); }
body.cn-on #side .cn-r.on { background: transparent; color: var(--accent); } body.cn-on #side .cn-r.on .ic { background: var(--accent-soft); }
body.cn-on #side .cn-r .badge { position: absolute; top: 4px; right: 10px; font-size: .66rem; min-width: 18px; padding: 1px 5px; }
body.cn-on #side .cn-grow { flex: 1; min-height: 8px; }
body.cn-on #side .cn-lockr { margin: 0; width: 100%; background: var(--accent); color: var(--accent-ink); min-height: 56px; box-shadow: none; }
body.cn-on #side .cn-lockr .ic { background: transparent !important; }
body.cn-on.side-mini #side { width: 92px; }
body.cn-on[data-page="rider"] #side { display: none; }
body.cn-on.side-mini #side .lb { display: block; }
@media (min-width: 901px) { body.cn-on:not([data-page="till"]) #menuBtn { display: none !important; } }

/* ---------- the footer (phone and small tablet) ---------- */
#cnFoot { display: none; }
@media (max-width: 900px) {
  body.cn-on #cnFoot:not([hidden]) { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 94%, transparent); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -12px rgb(0 0 0 / .25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  body.cn-on { --cn-foot-h: 64px; }
  body.cn-on:not([data-page="till"]):not([data-page="rider"]):not([data-page="lock"]) #shell { padding-bottom: calc(var(--cn-foot-h) + env(safe-area-inset-bottom)); }
  body.cn-on:not([data-page="till"]):not([data-page="lock"]) #toasts { bottom: calc(var(--cn-foot-h) + 10px); }
  body.cn-on #menuBtn { display: none; }
  body.cn-on[data-page="till"] #menuBtn { display: inline-block; }
  body.cn-on.side-open #side { display: none !important; }
}
body:has(#ckKiosk) #cnFoot, body[data-page="lock"] #cnFoot, body[data-page="till"] #cnFoot, body[data-page="rider"] #cnFoot { display: none !important; }
#cnFoot .cn-f { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border: 0; background: none; color: var(--muted); border-radius: 14px; padding: 4px 2px; font: inherit; min-width: 0; }
#cnFoot .cn-f .ic { font-size: 1.3rem; line-height: 1; display: inline-grid; place-items: center; width: 48px; height: 30px; border-radius: 999px; transition: background var(--ds-dur-1, .12s); }
#cnFoot .cn-f .lb { font-size: .7rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#cnFoot .cn-f.on { color: var(--accent); } #cnFoot .cn-f.on .ic { background: var(--accent-soft); }
#cnFoot .cn-f:active .ic { background: var(--soft); }
#cnFoot .cn-f .badge { position: absolute; top: 2px; left: calc(50% + 8px); font-size: .64rem; min-width: 17px; padding: 1px 5px; }

/* ---------- a parent's pop-up: its actions as boxes ---------- */
.modal.cn-pop .sheet { width: min(720px, 100%); }
.modal.cn-pop.wide .sheet { width: min(980px, 100%); }
.cn-sub { margin: -4px 0 12px; }
.cn-h { margin: 14px 0 8px; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); } .cn-sub + .cn-h { margin-top: 0; }
.cn-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; }
.cn-act { position: relative; display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 11px 14px; text-align: left; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; min-width: 0; box-shadow: var(--shadow); transition: border-color var(--ds-dur-1, .12s), transform var(--ds-dur-1, .12s); }
.cn-act:hover { border-color: var(--c, var(--accent)); transform: translateY(-1px); }
.cn-act.on { border-color: var(--accent); background: var(--accent-soft); }
.cn-act .ic { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; font-size: 1.35rem; background: color-mix(in srgb, var(--c, var(--accent)) 13%, var(--card)); }
.cn-act .tx { flex: 1; min-width: 0; display: grid; gap: 2px; } .cn-act b { font-size: .98rem; } .cn-act small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.cn-act .badge { flex: none; }
.cn-find { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); color: var(--muted); font: inherit; text-align: left; }
.cn-find span:first-child { font-size: 1.2rem; }
.cn-morefoot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; } .cn-morefoot .btn { min-height: 50px; }
@media (max-width: 640px) { .cn-acts { grid-template-columns: 1fr; gap: 8px; } .cn-act { min-height: 58px; padding: 9px 12px; } .cn-act .ic { width: 40px; height: 40px; } }

/* ---------- Home: one box per parent ---------- */
.cn-home .cn-pt { border-left-width: 1px; align-items: flex-start; }
.cn-home .cn-pt .ic { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); margin-bottom: 4px; }
.cn-home .home-title { color: var(--muted); }
@media (max-width: 640px) { .cn-home .home-quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .cn-home .home-quick .btn { flex: none; } }

/* ---------- modern tables (computer): roomy rows, sticky header, numbers on the right, no grid lines ---------- */
body.cn-on .tbl-wrap { border-radius: 16px; box-shadow: var(--shadow); }
body.cn-on .tbl th { font-size: .72rem; letter-spacing: .06em; font-weight: 700; padding: 12px 14px; background: var(--card); border-bottom: 1px solid var(--line); z-index: 1; }
body.cn-on .tbl td { padding: 12px 14px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
body.cn-on .tbl tbody tr:first-child td { border-top: 0; }
body.cn-on .tbl td.r, body.cn-on .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.cn-on .tbl tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* ---------- on a phone a table becomes cards: the first cell is the title, the rest are label · value lines ---------- */
@media (max-width: 640px) {
  body.cn-on .tbl-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  body.cn-on .tbl tbody { display: grid; gap: 8px; }
  body.cn-on .tbl tr { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 10px 2px 8px; box-shadow: var(--shadow); }
  body.cn-on .tbl td { padding: 3px 12px; border: 0; font-size: .9rem; overflow-wrap: anywhere; }
  body.cn-on .tbl td:first-child { font-size: 1rem; font-weight: 700; justify-content: flex-start; text-align: left; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  body.cn-on .tbl td:first-child::before { content: none; }
  body.cn-on .tbl td:empty { display: none; }
  body.cn-on .tbl tbody tr:hover td { background: transparent; }
}
@media print { #cnFoot { display: none !important; } }
