/* Simple layout. Everything is scoped to html[data-layout="simple"], so with
   "classic" (or this file removed) the app is exactly as it was. Colours come
   from the app's own theme tokens, so dark mode needs no second set. */

/* ---- Pieces that only exist for the layout (hidden in classic) ------------- */
html:not([data-layout="simple"]) .sx-nav,
html:not([data-layout="simple"]) .sx-brand,
html:not([data-layout="simple"]) .sx-foot,
html:not([data-layout="simple"]) .sx-quick,
html:not([data-layout="simple"]) .sx-tabs,
html:not([data-layout="simple"]) .sx-other,
html:not([data-layout="simple"]) .sx-rail-msg,
html:not([data-layout="simple"]) .sx-rail-out { display: none !important; }

.sx-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.sx-item .rail-ic svg { width: 19px; height: 19px; }
.sx-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.sx-brand .logo-mark { width: 26px; height: 26px; flex: 0 0 auto; color: var(--brand, var(--primary)); }
.sx-brand-name { font-size: 16px; font-weight: 700; line-height: 20px; color: var(--ink); }
.sx-brand-org { font-size: 12px; line-height: 16px; color: var(--ink-2); }
.sx-msg-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #D9482B; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.sx-msg-badge[hidden] { display: none; }

/* ---- The till -------------------------------------------------------------- */
html[data-layout="simple"][data-sx-page="till"] .trial-banner { display: none; }
html[data-layout="simple"] .qb-title,
html[data-layout="simple"] .qb-tabs,
html[data-layout="simple"] .qb-menubar > .qb-menu:not(.qb-usermenu),
html[data-layout="simple"] .qb-status > :not(.open-shift):not(.qb-spacer) { display: none; }

html[data-layout="simple"] .qb { background: var(--bg); color: var(--ink); font-size: 14px; }
html[data-layout="simple"] .qb-menubar {
  display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ink);
}
html[data-layout="simple"] .qb-menubar .qb-clockchip { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
html[data-layout="simple"] .qb-menubar .qb-clockchip * { background: none; color: inherit; border: 0; }
html[data-layout="simple"] .qb-menubar .qb-clockchip::before { display: none; }
html[data-layout="simple"] .qb-menubar .qb-usermenu > * { color: var(--ink); }
html[data-layout="simple"] .qb-status { min-height: 0; padding: 6px 20px; background: transparent; border: 0; }

.sx-tabs { display: flex; gap: 6px; margin-right: auto; }
.sx-tab { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.sx-tab:hover { background: var(--surface-2); }
.sx-tab.is-on { background: var(--t-blue-soft); color: var(--t-blue); }
.sx-tab-plain { cursor: default; font-weight: 500; }
.sx-tab-plain:hover { background: none; }

html[data-layout="simple"] .qb-body { grid-template-columns: 220px 1fr; }
html[data-layout="simple"] .qb-sidebar { padding: 14px 12px; gap: 4px; background: var(--surface); border-right: 1px solid var(--line); }
html[data-layout="simple"] .qb-sidebar > .qb-side-foot { display: none; }
html[data-layout="simple"] .qb-sidebar > .qb-side-list { display: none; }
html[data-layout="simple"] .qb-sidebar[data-more="1"] > .qb-side-list { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 6px 12px; border-left: 2px solid var(--line); margin: 4px 0 4px 14px; }
html[data-layout="simple"] .qb-side-list > [data-k="exchange"],
html[data-layout="simple"] .qb-side-list > [data-k="quick"],
html[data-layout="simple"] .qb-side-list > [data-k="add"],
html[data-layout="simple"] .qb-side-list > [data-k="messages"],
html[data-layout="simple"] .qb-side-list > [data-k="customize"],
html[data-layout="simple"] .qb-side-list > [data-k="minimize"] { display: none; }

.sx-nav { display: flex; flex-direction: column; gap: 4px; }
.sx-foot { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.qb-sidebar .sx-item { padding: 11px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.qb-sidebar .sx-item:hover { background: var(--surface-2); color: var(--ink); }
.qb-sidebar .sx-item.is-on { background: var(--primary); color: #fff; }

/* The scan box leads; everything else is a quiet chip beside it. */
html[data-layout="simple"] .qb-entry { flex-wrap: wrap; }
.sx-quick { display: flex; gap: 8px; flex: 1 0 100%; }
.sx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sx-chip:hover { border-color: var(--primary); color: var(--primary); }
.sx-chip svg { width: 16px; height: 16px; }

html[data-layout="simple"] .qb-row .c-size,
html[data-layout="simple"] .qb-row .c-hand { display: none; }

/* Payment: the three ways people actually pay, plus Account. */
html[data-layout="simple"] .qb-tenders { grid-template-columns: repeat(4, 1fr); gap: 10px; }
html[data-layout="simple"] .qb-tenders button { min-height: 58px; font-size: 15px; font-weight: 700; border-radius: 14px; }
html[data-layout="simple"] .qb-tenders [data-k="debit"],
html[data-layout="simple"] .qb-tenders [data-k="gift"],
html[data-layout="simple"] .qb-actions [data-k="save"],
html[data-layout="simple"] .qb-actions [data-k="print"] { display: none; }
html[data-layout="simple"] .qb-lower[data-other="1"] .qb-tenders [data-k="debit"],
html[data-layout="simple"] .qb-lower[data-other="1"] .qb-tenders [data-k="gift"] { display: flex; }
html[data-layout="simple"] .qb-lower[data-other="1"] .qb-actions [data-k="save"],
html[data-layout="simple"] .qb-lower[data-other="1"] .qb-actions [data-k="print"] { display: inline-flex; }
html[data-layout="simple"] .qb-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.sx-other { margin-right: auto; border: 0; background: none; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 4px; }
.sx-other:hover { text-decoration: underline; }

/* ---- Every other screen ---------------------------------------------------- */
html[data-layout="simple"] .app-rail .sx-item { padding: 0 14px; min-height: 40px; border-radius: 10px; font-size: 14px; font-weight: 500; color: inherit; opacity: .92; }
html[data-layout="simple"] .app-rail .sx-item:hover { background: rgba(255,255,255,.1); opacity: 1; }
html[data-layout="simple"] .app-rail .sx-rail-out { margin: 0 0 8px; }


/* ---- Messages window ------------------------------------------------------- */
.sx-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 24, 48, .45); }
.sx-card { width: min(480px, 100%); max-height: 80vh; overflow: auto; padding: 20px; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(10, 24, 48, .5); }
.sx-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sx-card-head h2 { margin: 0; font-size: 20px; }
.sx-x { border: 0; background: var(--surface-2); color: var(--ink-2); width: 34px; height: 34px; border-radius: 10px; font-size: 22px; line-height: 1; cursor: pointer; }
.sx-empty { color: var(--ink-2); padding: 16px 0; }
.sx-msg { display: grid; grid-template-columns: 14px 1fr; column-gap: 10px; row-gap: 2px; width: 100%; padding: 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.sx-msg:hover { border-color: var(--primary); }
.sx-msg .sx-dot { grid-row: 1; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--sev-blue); }
.sx-msg.sev-bad .sx-dot { background: var(--sev-red); }
.sx-msg.sev-warn .sx-dot { background: var(--sev-amber); }
.sx-msg .sx-sub { grid-column: 2; font-size: 13px; color: var(--ink-2); }

/* The way back to the old screens, small and out of the way. */
.sx-pill { position: fixed; right: 14px; bottom: 12px; z-index: 8000; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; opacity: .75; }
.sx-pill:hover { opacity: 1; color: var(--primary); }
html[data-layout="simple"] .sx-pill { display: none; }
html[data-layout="simple"][data-sx-page="dash"] .sx-pill { display: block; }

@media (max-width: 820px) {
  html[data-layout="simple"] .qb-body { grid-template-columns: 1fr; }
  html[data-layout="simple"] .qb-sidebar { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .sx-nav { flex-direction: row; }
  .sx-foot { flex-direction: row; margin: 0 0 0 auto; padding: 0; border: 0; }
  html[data-layout="simple"] .qb-tenders { grid-template-columns: repeat(2, 1fr); }
}

/* Exchange banner (shown in both layouts while an exchange is open). */
.xc-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; background: var(--t-amber-soft, #FDEDD8); color: var(--t-amber, #B4760F); border: 1px solid currentColor; font-weight: 600; font-size: 13px; }
.xc-banner .xc-text { flex: 1; }
.xc-banner .xc-cancel { border: 1px solid currentColor; background: transparent; color: inherit; padding: 6px 12px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; }
.xc-banner .xc-cancel[hidden] { display: none; }

/* 2.20.1: the till's "More tools" list, tidied. It used to scroll inside its
   own small box (two scrollbars), wrap names onto two lines and cut off
   "Cashier/Associate". Now the whole side panel scrolls as one, each tool
   sits on one line, and the indent is smaller so the full names fit. */
@media (min-width: 821px) {
  html[data-layout="simple"] .qb-body { grid-template-columns: 236px 1fr; }
  html[data-layout="simple"] .qb-sidebar { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-gutter: stable; }
  html[data-layout="simple"] .qb-sidebar > .sx-brand,
  html[data-layout="simple"] .qb-sidebar > .sx-nav,
  html[data-layout="simple"] .qb-sidebar > .sx-foot { flex: 0 0 auto; }
  html[data-layout="simple"] .qb-sidebar[data-more="1"] > .qb-side-list { flex: 0 0 auto; overflow: visible; min-height: auto; gap: 2px; margin: 2px 0 6px 14px; padding: 2px 0 2px 6px; border-left: 2px solid var(--line); }
  html[data-layout="simple"] .qb-sidebar .qb-side-list .qb-side { min-height: 40px; padding: 8px 10px; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; border-radius: 10px; text-align: left; justify-content: flex-start; }
  html[data-layout="simple"] .qb-sidebar .qb-side-list .qb-side .qb-ic { flex: 0 0 auto; }
  html[data-layout="simple"] .qb-sidebar .qb-side-list .qb-side .qb-side-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Theme colours, so the tools read the same in light and dark mode (the old light-only #30435B was dark blue on dark grey). */
  html[data-layout="simple"] .qb-sidebar .qb-side-list .qb-side { background: transparent; border: 1px solid transparent; box-shadow: none; color: var(--ink-2); }
  html[data-layout="simple"] .qb-sidebar .qb-side-list .qb-side:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
  html[data-layout="simple"] .qb-sidebar .qb-side-list .qb-side:disabled { background: transparent; border-color: transparent; color: var(--ink-3); opacity: .7; cursor: not-allowed; }
}
