/* ============================================================================
   THE CLICKEASY ADMIN CONSOLE (Luke's approved mock-up, 18 Nov 2026)
   A working console: navy menu on the left (navy is the Clickeasy login's
   colour everywhere in the app, e.g. its badge on Our school), the chosen
   section on the right. Stacks on a phone, the menu becoming a scrolling row.

   Everything is scoped under #acon so nothing here can restyle the app behind
   it. Light only, like the rest of the app. z-index 9000: above the app (the
   admin never lands on Breakfast/Lunch), but BELOW the admin modals (9999)
   and the support overlay (10001), which the moved-in tools open on top.
   ============================================================================ */
#acon {
  --acon-navy: #23235c; --acon-navy-2: #2f2f78; --acon-bg: #f5f5fa; --acon-panel: #fff;
  --acon-ink: #1b1b2e; --acon-muted: #63637e; --acon-line: #e3e3ef; --acon-orange: #F26A21;
  --acon-good: #1f7a46; --acon-good-bg: #e6f5ec; --acon-warn: #9a5b00; --acon-warn-bg: #fff3d6;
  --acon-bad: #b42318; --acon-bad-bg: #fdecea; --acon-info: #3b3bb3; --acon-info-bg: #ececfb;
  position: fixed; inset: 0; z-index: 9000; display: none;
  background: var(--acon-bg); color: var(--acon-ink);
  font-family: Nunito, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px;
  overflow: hidden;
}
#acon.on { display: block; }
#acon *, #acon *::before, #acon *::after { box-sizing: border-box; }
#acon .acon-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100%; }

/* menu */
#acon .acon-side { background: var(--acon-navy); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto;
  padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); }
#acon .acon-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
#acon .acon-brand .mk { width: 34px; height: 34px; border-radius: 9px; background: var(--acon-orange); display: grid; place-items: center; font-weight: 900; }
#acon .acon-brand b { font-weight: 900; font-size: 1.05rem; }
#acon .acon-brand small { display: block; font-size: .72rem; color: #b9b9e6; font-weight: 800; }
#acon .acon-nav { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  font-weight: 800; font-size: .9rem; color: #dcdcf5; white-space: nowrap; font-family: inherit; }
#acon .acon-nav:hover, #acon .acon-nav:focus-visible { background: var(--acon-navy-2); color: #fff; outline: none; }
#acon .acon-nav.on { background: #fff; color: var(--acon-navy); }
#acon .acon-nav .n { margin-left: auto; font-size: .7rem; background: var(--acon-orange); color: #fff; border-radius: 50px; padding: 1px 7px; }
#acon .acon-nav .n:empty { display: none; }
/* The mock-up's group headings: Customers, Money, Recipes & pictures … */
#acon .acon-grp { font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; padding: 12px 10px 4px; color: #b9b9e6; white-space: nowrap; }
#acon .acon-nav { line-height: 1.25; min-height: 0; }
/* "admin@clickeasy.com · Log out" at the foot of the menu. */
#acon .acon-foot { margin-top: auto; padding: 12px 8px 4px; font-size: .76rem; font-weight: 800; color: #b9b9e6; overflow-wrap: anywhere; }
#acon .acon-who:empty + .acon-dot { display: none; }

/* main */
#acon .acon-main { overflow-y: auto; min-width: 0; padding: 22px 28px 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
#acon .acon-view { display: none; flex-direction: column; gap: 18px; }
/* The app's own stylesheet narrows every <main> to 960px and centres it
   (styles.css), which squeezed the console into a box in the middle of the
   screen (Luke, 18 Nov). The console uses the whole width beside its menu. */
#acon main.acon-main { max-width: none; margin: 0; }
/* A wide table must scroll inside its own box, never push the page wider:
   on a phone the headings were cut off on the right. */
#acon .acon-view, #acon .acon-view > *, #acon .acon-body > * { min-width: 0; max-width: 100%; }
#acon .acon-view.on { display: flex; }
#acon .acon-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#acon .acon-top h1 { font-size: 1.5rem; font-weight: 900; margin: 0; text-wrap: balance; }
#acon .acon-top .sub { color: var(--acon-muted); font-weight: 700; font-size: .9rem; }
#acon .acon-search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--acon-panel); border: 1.5px solid var(--acon-line);
  border-radius: 50px; padding: 7px 14px; min-width: 0; width: min(340px, 100%); }
#acon .acon-search input { all: unset; flex: 1; min-width: 0; font-weight: 700; color: var(--acon-ink); font-family: inherit; }
#acon .acon-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* building blocks the sections share (the mock-up's own names, prefixed) */
#acon .acon-card { background: var(--acon-panel); border: 1.5px solid var(--acon-line); border-radius: 14px; padding: 16px; min-width: 0; }
#acon .acon-card h2 { font-size: 1rem; font-weight: 900; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
#acon .acon-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
#acon .acon-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
#acon .acon-kpi { background: var(--acon-panel); border: 1.5px solid var(--acon-line); border-radius: 14px; padding: 14px; }
#acon .acon-kpi .v { font-size: 1.7rem; font-weight: 900; font-variant-numeric: tabular-nums; }
#acon .acon-kpi .l { font-size: .8rem; color: var(--acon-muted); font-weight: 800; }
#acon .acon-kpi .d { font-size: .76rem; font-weight: 800; margin-top: 4px; }
#acon .acon-pill { display: inline-block; font-size: .72rem; font-weight: 900; border-radius: 50px; padding: 2px 9px; white-space: nowrap; }
#acon .acon-pill.ok { background: var(--acon-good-bg); color: var(--acon-good); }
#acon .acon-pill.wa { background: var(--acon-warn-bg); color: var(--acon-warn); }
#acon .acon-pill.no { background: var(--acon-bad-bg); color: var(--acon-bad); }
#acon .acon-pill.in { background: var(--acon-info-bg); color: var(--acon-info); }
#acon .acon-list { display: flex; flex-direction: column; }
#acon .acon-li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--acon-line); font-weight: 700; font-size: .88rem; }
#acon .acon-li:first-child { border-top: 0; }
#acon .acon-li .r { margin-left: auto; text-align: right; }
#acon .acon-note { font-size: .78rem; color: var(--acon-muted); font-weight: 700; }
#acon .acon-empty { color: var(--acon-muted); font-weight: 800; font-size: .9rem; }
#acon .acon-btn { all: unset; cursor: pointer; font-weight: 900; font-size: .84rem; border-radius: 10px; padding: 8px 12px; border: 1.5px solid var(--acon-line);
  background: var(--acon-panel); color: var(--acon-ink); text-align: center; font-family: inherit; }
#acon .acon-btn:hover, #acon .acon-btn:focus-visible { border-color: var(--acon-navy); outline: none; }
#acon .acon-btn.p { background: var(--acon-navy); color: #fff; border-color: var(--acon-navy); }
#acon .acon-btn.d { color: var(--acon-bad); border-color: var(--acon-bad); }

@media (max-width: 860px) {
  #acon .acon-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  #acon .acon-side { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 6px; padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  /* On a phone the menu is one scrolling row: no brand, no group headings,
     and the foot is just its Log out button, last in the row. */
  #acon .acon-brand, #acon .acon-grp, #acon .acon-who, #acon .acon-dot { display: none; }
  #acon .acon-foot { margin: 0; padding: 0; display: flex; align-items: center; }
  #acon .acon-main { padding: 18px 16px 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  #acon .acon-search { margin-left: 0; width: 100%; }
}
/* Money & usage table (app-admin-money.js) */
#acon .acon-mtable { width: 100%; border-collapse: collapse; font-size: .85rem; }
#acon .acon-mtable th, #acon .acon-mtable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--acon-line, #e5e7eb); vertical-align: top; }
#acon .acon-mtable .num { text-align: right; }
#acon .acon-mtable .kind { color: var(--acon-muted); font-size: .72rem; font-weight: 800; }

/* Before the first paint on a reload, student-boot.js marks a platform-admin
   login with html.acon-boot: the app stays hidden behind the console's navy
   until the console opens, so the tiles never flash past (Luke, 18 Nov). */
html.acon-boot body { background: #23235c; }
html.acon-boot body > *:not(#acon) { visibility: hidden !important; }

/* Log out: underlined words after the email, as the mock-up has it (and a
   button at the end of the menu row on a phone, above). */
#acon .acon-logout { all: unset; cursor: pointer; font-weight: 800; color: #fff; text-decoration: underline; white-space: nowrap; font-family: inherit; border-radius: 6px; }
#acon .acon-logout:hover, #acon .acon-logout:focus-visible { background: var(--acon-navy-2); outline: 2px solid var(--acon-orange); outline-offset: 2px; }

/* ── The mock-up's building blocks (settings-admin-v3, 20 Nov 2026) ───────
   Prefixed with acon- and scoped under #acon, like everything above. */
#acon .acon-top { align-items: flex-start; margin-bottom: -2px; }
#acon .acon-top h1 { font-size: 1.45rem; }
#acon .acon-top .sub { max-width: 62ch; }
#acon .acon-card h2 { flex-wrap: wrap; }
#acon .acon-card h2 small { font-weight: 700; color: var(--acon-muted); font-size: .8rem; }
#acon .acon-card h3 { font-size: .92rem; font-weight: 900; margin: 14px 0 6px; }
#acon .acon-kpi .v { font-size: 1.6rem; }
#acon .acon-kpi .d { color: var(--acon-muted); }
#acon .acon-pill.or { background: #fff1e8; color: #c24f12; }
#acon .acon-pill.gr { background: #ececf2; color: #4b4b63; }
/* a row: words on the left (with a small grey line under), things on the right */
#acon .acon-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--acon-line); font-weight: 700; font-size: .9rem; flex-wrap: wrap; }
#acon .acon-row:first-child { border-top: 0; }
#acon .acon-row > .w { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
#acon .acon-row small, #acon td small { display: block; color: var(--acon-muted); font-weight: 700; font-size: .78rem; }
#acon .acon-row .num { font-variant-numeric: tabular-nums; font-weight: 800; }
#acon .acon-more { flex-basis: 100%; min-width: 0; }
#acon .acon-more:empty { display: none; }
/* switches */
#acon .acon-sw { all: unset; cursor: pointer; width: 46px; height: 26px; border-radius: 50px; background: #c9c9da; position: relative; flex-shrink: 0; display: inline-block; vertical-align: middle; }
#acon .acon-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
#acon .acon-sw[aria-checked="true"] { background: var(--acon-good); }
#acon .acon-sw[aria-checked="true"]::after { left: 23px; }
#acon .acon-sw:focus-visible { outline: 2px solid var(--acon-orange); outline-offset: 2px; }
#acon .acon-sw[disabled] { opacity: .5; cursor: progress; }
@media (prefers-reduced-motion: reduce) { #acon .acon-sw::after { transition: none; } }
/* buttons: .s small, .n navy (the same as .p), .o orange */
#acon .acon-btn { white-space: nowrap; }
#acon .acon-btn.s { font-size: .76rem; padding: 5px 9px; }
#acon .acon-btn.n { background: var(--acon-navy); color: #fff; border-color: var(--acon-navy); }
#acon .acon-btn.o { background: var(--acon-orange); color: #fff; border-color: var(--acon-orange); }
#acon .acon-btn.dd { background: var(--acon-bad); color: #fff; border-color: var(--acon-bad); }
#acon .acon-btn.d:hover, #acon .acon-btn.d:focus-visible { border-color: var(--acon-bad); background: var(--acon-bad-bg); }
#acon .acon-btn[disabled], #acon .acon-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
#acon label.acon-btn input[type="file"] { display: none; }
#acon .acon-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* chips (filters, periods) */
#acon .acon-chips { display: flex; gap: 8px; flex-wrap: wrap; }
#acon .acon-chip { all: unset; cursor: pointer; font-size: .8rem; font-weight: 800; padding: 5px 12px; border-radius: 50px; border: 1.5px solid var(--acon-line); background: var(--acon-panel); font-family: inherit; }
#acon .acon-chip.on { background: var(--acon-navy); color: #fff; border-color: var(--acon-navy); }
#acon .acon-chip:focus-visible { outline: 2px solid var(--acon-orange); outline-offset: 2px; }
/* form fields */
#acon .acon-field { border: 1.5px solid var(--acon-line); border-radius: 10px; padding: 9px 12px; font: inherit; font-weight: 700; background: var(--acon-bg); color: var(--acon-ink); width: 100%; min-width: 0; }
#acon .acon-field:focus { outline: 2px solid var(--acon-orange); outline-offset: 1px; }
#acon .acon-field.auto { width: auto; }
#acon textarea.acon-field { resize: vertical; line-height: 1.45; }
#acon label.acon-lb { font-size: .8rem; font-weight: 900; color: var(--acon-muted); display: block; margin: 10px 0 4px; }
#acon label.acon-lb small { font-weight: 700; }
#acon .acon-form { max-width: 520px; }
#acon .acon-tick { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: .86rem; cursor: pointer; }
#acon .acon-tick input { width: 18px; height: 18px; flex-shrink: 0; }
#acon .acon-msg { font-weight: 800; font-size: .86rem; margin-top: 8px; line-height: 1.45; }
#acon .acon-msg:empty { display: none; }
#acon .acon-msg.bad { color: var(--acon-bad); }
#acon .acon-msg.good { color: var(--acon-good); }
#acon .acon-msg.wait { color: var(--acon-muted); }
/* tables: scroll inside their card, never widen the page */
#acon .acon-tablewrap { overflow-x: auto; }
#acon table.acon-t { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 640px; }
#acon table.acon-t th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--acon-muted); font-weight: 900; padding: 8px 10px; border-bottom: 1.5px solid var(--acon-line); }
#acon table.acon-t td { padding: 9px 10px; border-bottom: 1px solid var(--acon-line); font-weight: 700; vertical-align: middle; }
#acon table.acon-t .num { text-align: right; font-variant-numeric: tabular-nums; }
#acon table.acon-t .kind, #acon .acon-kind { font-size: .7rem; font-weight: 900; color: var(--acon-muted); display: block; }
#acon table.acon-t tr.acon-sub td { background: var(--acon-bg); padding: 10px 12px; }
/* the AI spend chart */
#acon .acon-chart { width: 100%; height: auto; display: block; }
#acon .acon-chart text { fill: var(--acon-muted); font: 700 10px Nunito, system-ui, sans-serif; }
#acon .acon-chart .gl { stroke: var(--acon-line); }
#acon .acon-chart .b1 { fill: var(--acon-navy); }
#acon .acon-chart .b2 { fill: var(--acon-orange); }
#acon .acon-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; font-weight: 800; color: var(--acon-muted); margin-top: 6px; }
#acon .acon-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
/* picture grid (Images) */
#acon .acon-imgs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
#acon .acon-img { all: unset; cursor: pointer; border: 1.5px solid var(--acon-line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; background: var(--acon-panel); min-width: 0; position: relative; }
#acon .acon-img:hover, #acon .acon-img:focus-visible { border-color: var(--acon-navy); }
#acon .acon-img.sel { border-color: var(--acon-orange); box-shadow: 0 0 0 2px var(--acon-orange); }
#acon .acon-img img { width: 100%; height: 96px; object-fit: contain; background: #f6f6fa; border-radius: 6px; }
#acon .acon-img b { font-size: .74rem; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
#acon .acon-img code, #acon code { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: .74rem; overflow-wrap: anywhere; }
#acon .acon-img small { font-size: .68rem; color: var(--acon-muted); font-weight: 800; }
#acon .acon-img .tag { position: absolute; top: 12px; right: 12px; }
#acon .acon-img input[type="checkbox"] { position: absolute; top: 12px; left: 12px; width: 18px; height: 18px; margin: 0; }
/* boxes that warn: red (drop in, a delete that reaches live) and amber */
#acon .acon-drop { border: 2px solid var(--acon-bad); border-radius: 12px; padding: 12px; background: var(--acon-bad-bg); color: var(--acon-bad); font-weight: 800; font-size: .86rem; line-height: 1.45; }
#acon .acon-drop b { color: inherit; }
#acon .acon-warnbox { border: 2px solid #f2c66b; border-radius: 12px; padding: 12px; background: var(--acon-warn-bg); color: #6b4000; font-weight: 800; font-size: .86rem; line-height: 1.45; }
/* an inline "are you sure?" — never a confirm() box */
#acon .acon-confirm { border: 2px solid var(--acon-bad); border-radius: 12px; padding: 12px; background: #fff8f7; display: flex; flex-direction: column; gap: 8px; font-weight: 800; font-size: .86rem; line-height: 1.45; margin-top: 8px; }
#acon .acon-confirm.calm { border-color: var(--acon-navy); background: #f7f7fd; }
#acon .acon-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 9px; background: #f0f0f6; flex-shrink: 0; }
#acon .acon-hide { display: none !important; }
/* a dialog the console opens over itself (Give to schools, picture details) */
#acon .acon-dlg { position: fixed; inset: 0; z-index: 9200; background: rgba(20, 20, 46, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
#acon .acon-dlg[hidden] { display: none; }
#acon .acon-dlg > div { background: var(--acon-panel); border-radius: 16px; width: min(520px, 100%); max-height: min(86vh, 820px); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
#acon .acon-dlg h2 { font-size: 1.1rem; font-weight: 900; margin: 0; padding-right: 40px; overflow-wrap: anywhere; }
#acon .acon-dlg .x { position: absolute; }
#acon .acon-dlg-head { display: flex; align-items: flex-start; gap: 10px; }
#acon .acon-dlg-head h2 { flex: 1; padding: 0; }
#acon .acon-scroll { max-height: 320px; overflow-y: auto; border: 1.5px solid var(--acon-line); border-radius: 10px; padding: 0 10px; }
@media (max-width: 860px) {
  #acon .acon-foot .acon-logout { padding: 9px 10px; border: 1.5px solid #3a3a86; border-radius: 10px; text-decoration: none; font-size: .9rem; color: #dcdcf5; }
  #acon .acon-top .acon-search { margin-left: 0; width: 100%; }
}

/* "Our own account, in the app" (aconOpenOwnApp): the navy bar across the top
   while the console has stepped aside for the app's editor and Settings. Not
   under #acon: it sits over the app. The Settings panel starts below it. */
#acon-app-bar { position: sticky; top: 0; z-index: 99998; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #23235c; color: #fff; font: 800 .88rem Nunito, system-ui, sans-serif; padding: .55rem .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.25);
  padding-left: max(.9rem, env(safe-area-inset-left, 0px)); padding-right: max(.9rem, env(safe-area-inset-right, 0px)); }
#acon-app-bar[hidden] { display: none; }
#acon-app-bar .t { flex: 1 1 220px; min-width: 0; }
#acon-app-bar button { margin-left: auto; padding: .35rem .9rem; border-radius: 8px; border: 2px solid #fff; background: transparent; color: #fff; font: 900 .82rem Nunito, system-ui, sans-serif; cursor: pointer; }
#acon-app-bar button:focus-visible { outline: 2px solid #F26A21; outline-offset: 2px; }
html.acon-inapp #settings-overlay { top: var(--acon-appbar-h, 46px) !important; }
@media (max-width: 600px) { #acon-app-bar .more { display: none; } }
