/* Parts used by every shell (phone, computer, platform, sign-in): form problems, dropdowns and the idle-session warning.
   Classes start with gbs- so they cannot collide with a shell's own. Loaded last, so it settles how these look. */

/* ---------- a field that needs attention ---------- */
.gbs-invalid .gbm-inp, .gbs-invalid .gba-input, .gbs-invalid .gba-select, .gbs-invalid input.gbm-inp, .gbs-invalid select.gbm-inp,
.gbs-invalid textarea, body.gbm-body .gbm-partycard.gbs-invalid { border-color: #B42318; background-color: #FFF8F7; }
.gbs-invalid .gbm-chips .gbm-chip, .gbs-invalid.gbm-seg { border-color: #B42318; }
.gbs-error { color: #B42318; font-size: 11.5px; font-weight: 700; line-height: 1.4; text-align: left; }
.gbm-partycard .gbs-error { flex-basis: 100%; }
body.gbm-body .gbm-partycard.gbs-invalid { flex-wrap: wrap; }
.gbs-toast { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 12px; background: #B42318; color: #fff; font: 700 13px/1.35 system-ui, sans-serif; text-align: center; box-shadow: 0 12px 28px -10px rgba(15, 23, 42, .5); }

/* bank / wallet block: gone entirely for cash, whatever else styles it */
[data-gbs-pay][hidden] { display: none !important; }

/* ---------- idle session warning ---------- */
.gbs-dialog { width: min(380px, calc(100vw - 32px)); padding: 20px; border: 0; border-radius: 18px; background: #fff; color: #0F172A; font: 14px/1.45 system-ui, sans-serif; box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .6); }
.gbs-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.gbs-dialog p { margin: 0 0 16px; }
.gbs-button { width: 100%; min-height: 46px; border: 0; border-radius: 12px; background: #1B72C4; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }

/* ---------- dropdowns ---------- */
/* One look everywhere. A select that sits inside a field box leaves the border to the box. */
select.gbm-inp, select.gba-select, .gbm-inp > select { text-overflow: ellipsis; cursor: pointer; }
.gbm-inp > select { height: 100%; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: inherit; padding: 0; }
body.gbm-body select.gbm-title-select { flex: 1; min-width: 0; height: 46px; padding: 0 12px; border: 1px solid #C9D3DF; border-radius: 10px; background-color: #fff; font: inherit; font-size: 14px; font-weight: 700; color: #0F172A; }

/* Browsers that can theme the opened list draw it in the app's colours; the others keep their own list. */
/* :not(#_) lifts these above the older per-screen rules that switched the native look off. */
@supports (appearance: base-select) {
  select:not(#_), select:not(#_)::picker(select) { appearance: base-select; }
  body select.gbm-inp:not(#_) { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 11px; background-image: none; }
  body.gbm-body .gbm-inp > select:not(#_) { display: flex; align-items: center; justify-content: space-between; min-height: 0; padding: 0; border: 0; background: transparent; }
  body.gbm-body select.gbm-title-select:not(#_) { display: flex; align-items: center; justify-content: space-between; }
  body.gba-body select.gba-select:not(#_) { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; border: 1px solid #C9D3E0; border-radius: 12px; background: #fff; }
  select::picker-icon { color: #64748B; margin-left: 8px; font-size: 10px; }
  /* the field box already draws its own arrow */
  .gbm-inp:has(> svg.gbm-inp-icon:last-child) > select::picker-icon { display: none; }
  ::picker(select) { min-width: anchor-size(width); max-height: min(340px, 60vh); overflow-y: auto; margin-block: 4px; padding: 6px; border: 1px solid #C9D3DF; border-radius: 14px; background: #fff; color: #0F172A; box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .45); }
  option { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 500; line-height: 1.35; cursor: pointer; }
  option:hover, option:focus-visible { background: #F1F6FD; outline: 0; }
  option:checked { background: #EAF2FB; color: #1B72C4; font-weight: 800; }
  option::checkmark { order: 1; margin-left: auto; }
  /* the account picker is a card; its select only opens the list */
  body.gbm-body .gbm-partycard select:not(#_) { opacity: 0; min-height: 0; }
}

/* ---------- password eye on platform forms ---------- */
.gba-tool.gba-eye { display: inline-flex; align-items: center; justify-content: center; width: 40px; padding: 0; }

@media print { .gbs-toast, .gbs-dialog, .gbs-error { display: none !important; } }

/* ---------- the one receipt ---------- */
body.gbm-body .gbm-receipt { width: 100%; max-width: 460px; margin: 0 auto; }
.gbm-receipt-due { font-weight: 800; }
.gbs-offscreen { display: block !important; position: fixed; left: -10000px; top: 0; width: 420px; }
/* On paper a page with a receipt prints the receipt, not the controls and extras around it. */
@media print {
  body.gbm-body .gbm-content:has(.gbm-receipt) > :not(.gbm-receipt):not(:has(.gbm-receipt)) { display: none !important; }
  body.gbm-body .gbm-receipt { box-shadow: none; max-width: 190mm; }
}

/* a group of related fields */
body.gbm-body .gbm-card.gbs-section { padding: 14px; }
body.gbm-body .gbm-content .gbs-section { flex-shrink: 0; }
/* the box shows the focus ring; the large figure inside must not draw a second one */
body.gbm-body .gbm-inp.gbm-big input:focus, body.gbm-body .gbm-inp.gbm-big input:focus-visible { outline: 0; box-shadow: none; }
.gbm-linehead.gbs-invalid { flex-wrap: wrap; }
.gbm-linehead .gbs-error { flex-basis: 100%; }

/* ---------- shops and warehouses ---------- */
body.gbm-body .gbs-places .gbs-column { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
body.gbm-body a.gbs-place, body.gbm-body .gbs-place { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.gbs-place-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gbs-place-text b { font-size: 14px; }
.gbs-place-text small, .gbs-figures small { font-size: 11.5px; color: #64748B; }
body.gbm-body .gbs-store { display: flex; flex-direction: column; gap: 10px; }
.gbs-figures { display: flex; gap: 8px; flex-wrap: wrap; }
body.gbm-body .gbm-card.gbs-figures { display: flex; flex-direction: row; }
.gbs-figures span { display: flex; flex-direction: column; flex: 1; min-width: 90px; padding: 8px 10px; border-radius: 10px; background: #F5F7FA; }
.gbs-figures b { font-size: 13px; }
@media (min-width: 961px) {
  body.gbw .gbm-phone .gbm-content.gbs-places { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  body.gbw .gbm-content.gbs-places > .gbs-column { grid-column: auto; }
}

/* ---------- list beside its detail (computer): the picked row keeps its text clear of the highlight ---------- */
body.gbw .gbw-table > .gbm-row, body.gbw .gbw-table > .gbw-th { padding-inline: 10px; }
body.gbw .gbw-table > a.gbm-row.gbm-picked-row { border-radius: 10px; }
/* a document that exists only to be shared as a PDF: laid out off screen while it is drawn */
.gbs-sharedoc { display: none; }
.gbs-sharedoc.gbs-offscreen { display: block; }

/* ---------- platform tables on a narrow screen scroll inside their card, not the page ---------- */
@media (max-width: 600px) {
  body.gba-body .gba-card { min-width: 0; }
  body.gba-body .gba-card > .gba-table { display: block; max-width: 100%; overflow-x: auto; }
}
[data-gbs-pay-for][hidden] { display: none !important; }

/* ---------- choosing a logo ---------- */
.gbs-logo { display: flex; flex-direction: column; gap: 8px; }
.gbs-logo-frame { display: flex; align-items: center; justify-content: center; width: 112px; height: 112px; border: 1px dashed #C9D3DF; border-radius: 16px; background: #fff; color: #64748B; font-size: 12px; overflow: hidden; }
.gbs-logo-frame img { width: 100%; height: 100%; object-fit: contain; }
.gbs-logo-frame [hidden], .gbs-logo-frame img[hidden] { display: none; }
.gbs-logo input[type=file] { font-size: 13px; max-width: 100%; }
.gbs-logo-hint { font-size: 11.5px; color: #64748B; }
.gbs-logo [data-gbs-logo-error][hidden] { display: none; }
.gbm-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.gbs-shoplogo { width: 22px; height: 22px; object-fit: contain; border-radius: 6px; background: #fff; }
.gbs-tenantlogo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; border: 1px solid #E3E8EF; background: #fff; }

/* ---------- phone number with its country ---------- */
.gbs-phone { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; width: 100%; }
body select.gbs-dial:not(#_) { flex: none; width: auto; min-width: 82px; min-height: 30px; height: 30px; padding: 0 6px; border: 0; border-right: 1px solid #E3E8EF; border-radius: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 700; color: #1B72C4; display: inline-flex; align-items: center; }
.gbs-phone .gbs-number { flex: 1; min-width: 0; }
body input.gbs-phone-value { display: none !important; }
/* the sign-out row at the end of the phone's menu */
.gbs-signout { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: #B42318; }
.gbs-signout .gbm-av { color: #B42318; background: #FEF3F2; }
/* a number and its country need the whole row on a narrow screen */
@media (max-width: 600px) { body .gbm-two:has(> * .gbs-phone) { grid-template-columns: minmax(0, 1fr); } }
body.gba-body .gbs-phone select.gbs-dial:not(#_) { height: 48px; border: 1px solid #C9D3E0; border-radius: 12px; background: #fff; }

/* ---------- receive stock: item, quantity, rate and made on one row at every width ---------- */
body.gbm-body .gbs-line { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, .65fr) minmax(0, .95fr) minmax(0, .95fr) 24px; gap: 6px; align-items: start; }
body.gbm-body .gbs-line .gbm-fld { min-width: 0; margin: 0; }
body.gbm-body .gbs-line label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.gbm-body .gbs-line .gbm-inp { height: 44px; padding: 0 8px; gap: 0; min-width: 0; }
body.gbm-body .gbs-line input { text-overflow: ellipsis; }
body.gbm-body .gbs-line select.gbm-title-select:not(#_) { width: 100%; height: 44px; min-height: 44px; padding: 0 8px; font-size: 13px; }
body.gbm-body .gbs-line .gbs-line-remove { align-self: start; margin-top: 21px; height: 44px; padding: 0; }
body.gbm-body .gbs-line .gbs-error { font-size: 10.5px; }
.gbs-line-note { margin-top: -2px; }
@media (max-width: 420px) {
  body.gbm-body .gbs-line { gap: 4px; grid-template-columns: minmax(0, 1.45fr) minmax(0, .6fr) minmax(0, .85fr) minmax(0, 1fr) 18px; }
  body.gbm-body .gbs-line .gbm-inp, body.gbm-body .gbs-line select.gbm-title-select:not(#_) { padding: 0 4px; font-size: 12px; }
}

/* ---------- a free plan's printouts carry the maker's mark (the PDF file draws the same words itself) ---------- */
@media print {
  body[data-gbs-watermark]:not([data-gbs-watermark=""])::after { content: attr(data-gbs-watermark); position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    transform: rotate(-35deg); font: 800 34px system-ui, sans-serif; color: rgba(27, 114, 196, .16); white-space: nowrap; pointer-events: none; z-index: 2147483647;
    visibility: visible !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
