/* Benito web shell. Every value is a token (var(--...)) from theme.<name>.css; there is no colour here.
   Mobile first at 360 px: the bottom bar is the navigation, the side bar appears from 1024 px. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--app-background-color, white);
  color: var(--text-primary-color);
  font-family: var(--font-family-base), system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--font-text, 13px);
  line-height: 1.45;
}

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
.icon { width: 22px; height: 22px; flex: none; }

/* ---- Controls: every touch target is at least 44 px ------------------------------------------------ */

.btn, .input, .icon-btn, .menu-item, .tab, .side-link, .sheet-link, .usermenu__chip, .lang {
  min-height: 44px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 18px; border: 1px solid var(--border-color); border-radius: var(--radius-button, 12px);
  background: var(--surface-color); color: var(--text-primary-color);
  font: inherit; font-size: var(--font-subheading, 15px); font-weight: 600; cursor: pointer;
}
.btn--primary { background: var(--primary-color); border-color: var(--primary-color); color: var(--on-primary-text-color); }
.btn--primary:hover { background: var(--primary-hover-color); }
.btn--danger { background: var(--danger-color); border-color: var(--danger-color); color: var(--on-primary-text-color); }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px;
  border: 0; border-radius: var(--radius-button, 12px); background: transparent; color: var(--text-secondary-color); cursor: pointer;
}

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field__label { font-size: var(--font-label, 12px); font-weight: 600; color: var(--text-secondary-color); }
.input {
  width: 100%; padding: 0 14px; border: 1px solid var(--border-color); border-radius: var(--radius-input, 12px);
  background: var(--input-bg-color); color: var(--text-primary-color); font: inherit; font-size: 16px; /* 16 px: iOS does not zoom */
}
.input:focus { outline: 2px solid var(--primary-color); outline-offset: 0; background: var(--surface-focus-brush); }

.alert { padding: 10px 14px; border-radius: var(--radius-small, 8px); margin-bottom: 14px; font-weight: 600; }
.alert--danger { background: var(--danger-light-color); color: var(--danger-dark-color); }

.card {
  background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--radius-card, 14px);
  padding: 20px; box-shadow: 0 6px 20px color-mix(in srgb, var(--shadow-card-color) 6%, transparent);
}

/* ---- Pages ----------------------------------------------------------------------------------------- */

.page { display: grid; gap: 16px; align-content: start; min-width: 0; }
.page__title { font-size: var(--font-heading, 22px); font-weight: 800; }
.soon__text { color: var(--text-secondary-color); font-size: var(--font-subheading, 15px); }

/* ---- Login (static page, no shell) ---------------------------------------------------------------- */

.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 16px;
  background: linear-gradient(160deg, var(--auth-gradient-start-color), var(--auth-gradient-end-color));
  color: var(--text-primary-color); font-family: var(--font-family-base), system-ui, sans-serif;
}
.auth__card {
  width: 100%; max-width: 400px; background: var(--surface-color); border-radius: var(--radius-auth-card, 30px);
  padding: 28px 22px; box-shadow: 0 20px 60px color-mix(in srgb, var(--shadow-auth-card-color) 25%, transparent);
}
.auth__brand { display: flex; align-items: baseline; justify-content: center; font-size: 30px; font-weight: 800; }
.auth__suffix { color: var(--primary-color); }
.auth__tagline { text-align: center; color: var(--text-muted-color); margin: 4px 0 22px; }
.auth__title { text-align: center; font-size: var(--font-heading, 22px); margin-bottom: 16px; }
.auth__lang { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.lang {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 0 12px;
  border-radius: var(--radius-chip, 20px); color: var(--text-secondary-color); font-weight: 700;
}
.lang--on { background: var(--primary-light-color); color: var(--primary-color); }

/* Business picker (login, several businesses for one email): one large touch target per business. */
.picker { display: grid; gap: 10px; margin: 0 0 14px; }
.picker__form { margin: 0; }
.picker__option { min-height: 56px; font-size: var(--font-subheading, 15px); font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.picker__other { display: flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 700; color: var(--primary-color); }

/* ---- Shell ----------------------------------------------------------------------------------------- */

.app {
  min-height: 100dvh; display: flex; background: var(--app-background-color); color: var(--text-primary-color);
  font-family: var(--font-family-base), system-ui, -apple-system, "Segoe UI", sans-serif;
}
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; min-width: 0; padding: 16px; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

.topbar {
  position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 12px 0 16px; background: var(--surface-color); border-bottom: 1px solid var(--border-color);
}
.topbar__business { font-weight: 800; font-size: var(--font-subheading, 15px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.usermenu { position: relative; flex: none; }
.usermenu__chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 8px 0 4px; border: 0; background: transparent;
  color: var(--text-primary-color); font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius-chip, 20px);
}
.usermenu__name { display: none; }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-color); color: var(--on-primary-text-color); font-weight: 800;
}
.usermenu__panel {
  position: absolute; right: 0; top: 100%; z-index: 30; min-width: 220px; padding: 8px; background: var(--surface-color);
  border: 1px solid var(--border-color); border-radius: var(--radius-card, 14px);
  box-shadow: 0 16px 36px color-mix(in srgb, var(--shadow-popup-color) 16%, transparent);
}
.usermenu__who { display: grid; padding: 8px 12px 10px; border-bottom: 1px solid var(--border-color); margin-bottom: 6px; }
.usermenu__who span { color: var(--text-muted-color); font-size: var(--font-label, 12px); }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 0 12px; border: 0;
  border-radius: var(--radius-small, 8px); background: transparent; color: var(--text-primary-color); font: inherit; text-align: left; cursor: pointer;
}
.menu-item:hover:not(:disabled) { background: var(--primary-soft-color); }
.menu-item:disabled { color: var(--text-muted-color); cursor: default; }
.menu-item small { color: var(--text-muted-color); }
.menu-item--danger { color: var(--danger-dark-color); }

/* Side bar: hidden on a phone. */
.sidebar { display: none; }

/* Bottom bar: the phone's navigation. */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface-color); border-top: 1px solid var(--border-color);
}
.tab {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 6px 2px; border: 0; background: transparent; color: var(--text-muted-color); font: inherit;
  font-size: var(--font-caption, 11px); font-weight: 600; cursor: pointer;
}
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab--on { color: var(--primary-color); }

/* "More" sheet. */
.sheet-scrim { position: fixed; inset: 0; z-index: 40; background: var(--drawer-scrim-brush); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 80dvh; overflow-y: auto;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); background: var(--surface-color);
  border-radius: var(--radius-auth-tile, 22px) var(--radius-auth-tile, 22px) 0 0;
}
.sheet__grip { width: 40px; height: 4px; margin: 4px auto 12px; border-radius: 2px; background: var(--border-color); }
.sheet__title { font-size: var(--font-subheading, 15px); padding: 0 8px 8px; }
.sheet__list { display: grid; }
.sheet-link {
  display: flex; align-items: center; gap: 14px; padding: 0 12px; border-radius: var(--radius-small, 8px);
  font-size: var(--font-subheading, 15px); font-weight: 600;
}
.sheet-link:hover { background: var(--primary-soft-color); }
.sheet-link--on { background: var(--primary-light-color); color: var(--primary-color); }

/* Drawers: a full-screen sheet on a phone, a side panel from 640 px. */
.drawer-scrim { position: fixed; inset: 0; z-index: 50; background: var(--drawer-scrim-brush); }
.drawer {
  position: fixed; inset: 0; z-index: 51; display: flex; flex-direction: column; background: var(--surface-color);
}
.drawer__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 4px 16px; border-bottom: 1px solid var(--border-color); }
.drawer__title { font-size: var(--font-subheading, 15px); font-weight: 800; }
.drawer__body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }

/* Prompts. */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--drawer-scrim-brush); }
.modal {
  width: 100%; max-width: 420px; padding: 22px; background: var(--surface-color); border-radius: var(--radius-card, 14px);
  box-shadow: 0 16px 36px color-mix(in srgb, var(--shadow-popup-color) 16%, transparent);
}
.modal__title { font-size: var(--font-subheading, 15px); font-weight: 800; margin-bottom: 8px; }
.modal__text { color: var(--text-secondary-color); margin-bottom: 18px; font-size: var(--font-text, 13px); }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (min-width: 640px) {
  .drawer { left: auto; width: 440px; box-shadow: -10px 0 30px color-mix(in srgb, var(--shadow-drawer-color) 18%, transparent); }
  .drawer--wide { width: 640px; }
  .usermenu__name { display: inline; }
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex; flex-direction: column; flex: none; width: 232px; position: sticky; top: 0; height: 100dvh;
    padding: 16px 12px; background: var(--sidebar-bg-brush); color: var(--sidebar-text-brush);
  }
  .sidebar__brand { display: flex; align-items: baseline; padding: 8px 10px 20px; font-size: 22px; font-weight: 800; }
  .sidebar__suffix { color: var(--sidebar-logo-suffix-brush); }
  .sidebar__nav { display: grid; gap: 4px; overflow-y: auto; }
  .side-link {
    display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: var(--radius-sidebar, 11px);
    color: var(--sidebar-text-dim-brush); font-weight: 600;
  }
  .side-link:hover { background: var(--sidebar-hover-bg-brush); }
  .side-link--on { background: var(--sidebar-active-bg-brush); color: var(--sidebar-text-brush); }
  .bottombar { display: none; }
  .main { padding: 24px 28px; }
}

/* ---- The counter (POS) and its dialogs (E44 tanda 1) ------------------------------------------------ */

.muted { color: var(--text-muted-color); }
.ok { color: var(--success-dark-color); font-weight: 600; }
.warn { color: var(--warning-dark-color); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.btn--small { padding: 0 12px; font-size: var(--font-text, 13px); }
.alert--success { background: var(--success-light-color); color: var(--success-dark-color); }
.alert--warning { background: var(--warning-light-color); color: var(--warning-dark-color); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip {
  flex: none; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-color); border-radius: var(--radius-chip, 20px);
  background: var(--surface-color); color: var(--text-secondary-color); font: inherit; font-weight: 600; cursor: pointer;
}
.chip--on { background: var(--primary-color); border-color: var(--primary-color); color: var(--on-primary-text-color); }
.chip--danger { display: inline-block; min-height: 0; padding: 2px 10px; background: var(--danger-light-color); border-color: transparent; color: var(--danger-dark-color); font-size: var(--font-caption, 11px); cursor: default; justify-self: start; }

.pos { display: grid; gap: 16px; min-width: 0; padding-bottom: 72px; }
.pos__catalog { display: grid; gap: 12px; align-content: start; min-width: 0; }
.pos__empty { padding: 8px 0; }
.pos-search { display: flex; gap: 8px; }
.pos-search .input { flex: 1; min-width: 0; }

.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pos-card {
  display: grid; gap: 4px; align-content: start; min-width: 0; padding: 10px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  border: 1px solid var(--border-color); border-radius: var(--radius-card, 14px); background: var(--surface-color);
}
.pos-card:hover { border-color: var(--primary-color); }
.pos-card--out { opacity: 0.65; }
.pos-card--blocked { opacity: 0.45; }
.pos-card__photo {
  display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: var(--radius-small, 8px); background: var(--primary-light-color);
}
.pos-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.pos-card__initial { font-size: var(--font-heading, 22px); font-weight: 800; color: var(--primary-color); }
.pos-card__name {
  font-weight: 700; overflow-wrap: anywhere; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pos-card__price { font-weight: 800; color: var(--primary-color); }
.pos-card__stock { font-size: var(--font-caption, 11px); color: var(--text-muted-color); }
.pos-card__note { font-size: var(--font-caption, 11px); color: var(--text-muted-color); overflow-wrap: anywhere; }
/* A tile with a shortcut beside it ("Traer", "Cantidad"): the card fills the cell, the button sits under it. */
.pos-cell { display: grid; gap: 6px; align-content: start; min-width: 0; }
.pos-cell > .pos-card { height: 100%; }
/* Traspasos: the title leaves the room to the button beside it. */
.pos-tools .page__title { margin-right: auto; }
/* Traspasos: the two places as big buttons with the swap between them. */
.tr-places { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.tr-place { display: grid; gap: 2px; min-height: 56px; padding: 8px 14px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  border: 1px solid var(--border-color); border-radius: var(--radius-card, 14px); background: var(--surface-color); min-width: 0; }
.tr-place:hover { border-color: var(--primary-color); }
.tr-place small { color: var(--text-muted-color); }
.tr-place strong { font-size: var(--font-subheading, 15px); overflow-wrap: anywhere; }
.tr-line__max { font-size: var(--font-caption, 11px); color: var(--text-muted-color); }

/* The cart: a sheet on a phone (opened from the summary bar), a column from 1024 px. */
.pos__cart { display: none; }
.pos--cart-open .pos__cart {
  position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; gap: 12px; overflow-y: auto;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface-color);
}
.pos--cart-open .pos-bar { display: none; }
.pos-cart__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pos-cart__head h2 { font-size: var(--font-subheading, 15px); font-weight: 800; }
.pos-cart__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pos-cart__foot { display: grid; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-color); }
.pos-cart__total { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--font-subheading, 15px); }
.pos-cart__total strong { font-size: var(--font-heading, 22px); }

.pos-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pos-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text total" "qty tools"; gap: 6px 10px; align-items: center;
  padding: 10px; border: 1px solid var(--border-color); border-radius: var(--radius-small, 8px);
}
.pos-line__text { grid-area: text; display: grid; min-width: 0; }
.pos-line__name { font-weight: 700; overflow-wrap: anywhere; }
.pos-line__total { grid-area: total; text-align: right; }
.pos-line__qty { grid-area: qty; display: flex; align-items: center; gap: 2px; }
.pos-line__input { width: 64px; padding: 0 6px; text-align: center; }
.pos-line__tools { grid-area: tools; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.pos-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 24;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 18px;
  border: 0; border-radius: var(--radius-button, 12px); background: var(--primary-color); color: var(--on-primary-text-color);
  font: inherit; font-size: var(--font-subheading, 15px); font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--shadow-popup-color) 24%, transparent);
}

/* Dialogs of the counter (they live in the shell's drawer). */
.dialog-form { display: grid; gap: 4px; }
.dialog-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; font-size: var(--font-subheading, 15px); }
.dialog-total strong { font-size: var(--font-heading, 22px); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.inline-form { padding: 12px; margin-bottom: 12px; border: 1px solid var(--border-color); border-radius: var(--radius-small, 8px); }
.input--area { min-height: 88px; padding: 10px 14px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; }

.pay { display: grid; gap: 0; }
.pay-fixed { position: sticky; top: -16px; z-index: 2; margin: -16px -16px 0; padding: 16px 16px 12px; background: var(--surface-color); }
.pay-summary { display: grid; padding: 12px 16px; border-radius: var(--radius-input, 10px); background: var(--primary-light-color); }
.pay-summary__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 8px; font-size: var(--font-text, 13px); font-weight: 600; color: var(--text-secondary-color); }
.pay-summary__row strong { font-size: var(--font-subheading, 15px); font-weight: 800; color: var(--text-primary-color); }
.pay-summary__row--total { margin-top: 0; color: var(--primary-color); }
.pay-summary__row--total strong { font-size: var(--font-heading, 22px); color: var(--primary-color); }
.pay-summary__row--due strong, .pay-summary__note--due { color: var(--danger-dark-color); }
.pay-summary__row--change { margin-top: 4px; }
.pay-summary__row--change strong { color: var(--success-dark-color); }
.pay-summary__note { text-align: right; font-size: var(--font-label, 12px); color: var(--text-secondary-color); }
.pay-summary__note--total { color: var(--primary-color); }
.pay-summary__note--pending { margin-top: 4px; font-weight: 600; color: var(--warning-dark-color); }
.pay-customer { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.pay-customer .field { flex: 1; min-width: 0; margin-bottom: 0; }
.pay-customer__add { width: 44px; padding: 0; font-size: var(--font-heading, 22px); font-weight: 400; }
.pay-card { display: grid; gap: 4px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--border-color); border-radius: var(--radius-card, 14px); }
.pay-card__row { display: flex; justify-content: space-between; gap: 12px; font-size: var(--font-label, 12px); color: var(--text-secondary-color); }
.pay-card__row strong { color: var(--text-primary-color); }
.pay-line { display: grid; gap: 10px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--border-color); border-radius: var(--radius-card, 14px); background: var(--surface-color); }
.pay-line .field { margin-bottom: 0; }
.pay-line__head { display: flex; align-items: center; gap: 8px; }
.pay-line__title, .pay-line__status { font-size: var(--font-label, 12px); font-weight: 600; color: var(--text-secondary-color); }
.pay-line__status { flex: 1; }
.pay-line__remove { margin-left: auto; }
.pay-line__amount { display: flex; align-items: center; gap: 10px; }
.pay-line__amount .input { min-width: 0; flex: 1; }
.pay-line__amount .pay-line__currency { flex: 0 0 130px; }
.pay-line__code { font-weight: 600; color: var(--text-secondary-color); }
.pay-line__equivalent { font-size: var(--font-label, 12px); color: var(--text-secondary-color); }
.pay-line__note { margin-bottom: 0; }
.pay-seg { display: flex; padding: 3px; gap: 3px; border-radius: var(--radius-input, 10px); background: var(--primary-light-color); }
.pay-seg__item { flex: 1; min-height: 44px; border: 0; border-radius: var(--radius-small, 8px); background: transparent; color: var(--text-secondary-color); font: inherit; font-size: var(--font-text, 13px); font-weight: 600; cursor: pointer; }
.pay-seg__item--on { background: var(--surface-color); color: var(--primary-color); font-weight: 800; }
.pay-qr { display: grid; justify-items: center; gap: 4px; padding: 12px 14px; text-align: center; border: 1px solid var(--border-color); border-radius: var(--radius-card, 14px); }
.pay-qr__plate { display: grid; place-items: center; width: min(240px, 100%); aspect-ratio: 1; background: white; border-radius: var(--radius-input, 10px); }
.pay-qr__img { width: 100%; height: 100%; padding: 10px; box-sizing: border-box; image-rendering: pixelated; }
.pay-qr__none { max-width: 150px; font-weight: 600; color: var(--text-muted-color); }
.pay-qr__account { margin-top: 4px; font-family: var(--font-family-mono, monospace); font-size: var(--font-label, 12px); font-weight: 600; overflow-wrap: anywhere; }
.pay-qr__hint { font-size: var(--font-label, 12px); color: var(--text-secondary-color); }
/* "Agregar pago": a compact ghost button on its own line, right-aligned and as wide as its text, so a stray tap
   below the amount field does not land on it. The 44 px height is the touch rule; the 8 px on top plus the
   10 px under the last line make an 18 px gap. */
.pay-add {
  justify-self: end; width: auto; margin: 8px 0 14px; padding: 0 12px;
  border-color: transparent; background: transparent; color: var(--primary-color);
  font-size: var(--font-text, 13px); font-weight: 700;
}
.pay-add:hover { background: var(--primary-light-color); }
.dialog-actions--fill { justify-content: stretch; }
.dialog-actions--fill .btn { flex: 1 1 0; }
.dialog-actions--fill .dialog-actions__wide { flex-basis: 100%; }
@media (max-width: 767px) {
  .dialog-actions--fill { position: sticky; bottom: -16px; margin: 12px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface-color); border-top: 1px solid var(--border-color); }
}

.receipt { display: grid; gap: 4px; }
.receipt__business { margin: 0; font-size: var(--font-subheading, 15px); font-weight: 800; }
.receipt__number { font-weight: 800; font-size: var(--font-subheading, 15px); }
.receipt__table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.receipt__table th, .receipt__table td { padding: 6px 4px; border-bottom: 1px solid var(--border-color); text-align: left; overflow-wrap: anywhere; }
.receipt__table th.num, .receipt__table td.num { text-align: right; }

@media (min-width: 1024px) {
  .pos { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; padding-bottom: 0; }
  .pos__cart {
    position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100dvh - 104px); overflow-y: auto;
    padding: 16px; border: 1px solid var(--border-color); border-radius: var(--radius-card, 14px); background: var(--surface-color);
  }
  .pos-bar, .pos-cart__close { display: none; }
}

/* ---- E44 tanda 2: the list component, nomenclators, forms of the catalogue ---- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dialog-lead { margin: 0 0 8px; }
.chip--small { display: inline-block; min-height: 0; padding: 1px 8px; margin-left: 6px; font-size: var(--font-caption, 11px); }
.chip--ok { display: inline-block; min-height: 0; padding: 2px 10px; background: var(--success-light-color); border-color: transparent; color: var(--success-dark-color); font-size: var(--font-caption, 11px); }
.chip--off { display: inline-block; min-height: 0; padding: 2px 10px; background: var(--surface-focus-brush); border-color: transparent; color: var(--text-muted-color); font-size: var(--font-caption, 11px); }

.wtable-wrap { display: grid; gap: 12px; min-width: 0; }
.wtable-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.wtable-toolbar > * { min-width: 0; }
.wtable-search { flex: 1 1 200px; }
.wtable-filters { flex: 1 1 100%; order: 5; }
.wtable-filter, .wtable-date { flex: 0 1 160px; }
.wtable-state { padding: 16px 0; text-align: center; }
.wtable-sort { position: relative; }
.wmenu {
  position: absolute; right: 0; z-index: 30; min-width: 190px; display: grid; padding: 6px;
  background: var(--surface-brush); border: 1px solid var(--border-color); border-radius: var(--radius-card, 12px); box-shadow: 0 8px 24px var(--drawer-scrim-brush);
}
.wmenu .menu-item { text-align: left; justify-content: flex-start; }
.wtable { width: 100%; border-collapse: collapse; background: var(--surface-brush); border: 1px solid var(--border-color); border-radius: var(--radius-card, 12px); }
.wtable th { padding: 10px 12px; text-align: left; font-size: var(--font-label, 12px); font-weight: 700; color: var(--text-secondary-color); border-bottom: 1px solid var(--border-color); }
.wtable td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); vertical-align: middle; overflow-wrap: anywhere; }
.wtable tr:last-child td { border-bottom: 0; }
.wtable__actions { position: relative; width: 52px; text-align: right; }
.product-cell { display: flex; align-items: center; gap: 10px; }
.product-cell__photo { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.wtable-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wtable-pager__range { font-size: var(--font-caption, 11px); }

/* Phones and small tablets: every row is a card, never a horizontal scroll. */
@media (max-width: 768px) {
  .wtable, .wtable tbody { display: block; border: 0; background: transparent; }
  .wtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wtable tr { display: block; position: relative; margin-bottom: 10px; padding: 8px 12px; background: var(--surface-brush); border: 1px solid var(--border-color); border-radius: var(--radius-card, 12px); }
  .wtable td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .wtable td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; font-size: var(--font-label, 12px); font-weight: 600; color: var(--text-secondary-color); }
  .wtable td.wtable__primary { display: block; padding-right: 44px; text-align: left; font-weight: 700; }
  .wtable td.wtable__primary::before { content: none; }
  .wtable td.wtable__actions { position: absolute; top: 4px; right: 4px; width: auto; padding: 0; display: block; }
  .wtable td.wtable__actions::before { content: none; }
  .wmenu { right: 0; }
}

.nom-tabs { display: none; flex-wrap: wrap; gap: 8px; }
.nom-list { list-style: none; margin: 0; padding: 0; }
.nom-list__item { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 52px; padding: 0 16px; background: transparent; border: 0; border-bottom: 1px solid var(--border-color); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.nom-list li:last-child .nom-list__item { border-bottom: 0; }
.nom-detail { display: grid; gap: 12px; min-width: 0; }
.nom--list .nom-detail { display: none; }
.nom--detail .nom-list { display: none; }
.nom-back { justify-self: start; }
@media (min-width: 769px) {
  .nom-tabs { display: flex; }
  .nom-list, .nom-back { display: none; }
  .nom--list .nom-detail { display: grid; }
}

.quick-add__row { display: flex; gap: 8px; }
.quick-add__row .input { flex: 1; min-width: 0; }
.quick-add__band { display: grid; gap: 8px; margin-top: 8px; padding: 12px; background: var(--surface-focus-brush); border-radius: var(--radius-small, 8px); }
.quick-add__actions { display: flex; justify-content: flex-end; gap: 8px; }
.photo-field { margin-bottom: 14px; }
.photo-field__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-field__preview { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: var(--surface-focus-brush); font-size: var(--font-caption, 11px); }
.photo-field__buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-field__pick { position: relative; cursor: pointer; }
.price-section { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.price-section__hint, .price-section__note { margin: 4px 0 8px; font-size: var(--font-caption, 11px); }
.price-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px 8px; border-radius: var(--radius-small, 8px); border: 1px solid var(--border-color); }
.price-row--fixed { border-color: var(--primary-color); background: var(--primary-soft-color); }
.price-row__pick { display: flex; align-items: center; gap: 8px; flex: 1 1 40%; min-height: 44px; }
.price-row__pick input { width: 20px; height: 20px; }
.price-row__input { flex: 1 1 40%; min-width: 0; text-align: right; }

/* ---- E44 tanda 3: purchases, expenses, customers, orders, cost sheets ---- */
.chip--warn { display: inline-block; min-height: 0; padding: 2px 10px; background: var(--warning-light-color); border-color: transparent; color: var(--warning-dark-color, var(--text-primary-color, inherit)); font-size: var(--font-caption, 11px); cursor: default; }
.text-danger { color: var(--danger-dark-color); }
.wtable-check { flex: 0 0 auto; }
.summary-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.summary { display: grid; gap: 4px; padding: 12px 16px; min-width: 140px; flex: 1 1 140px; }
.summary strong { font-size: var(--font-heading, 20px); }
.history__list, .plain-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.history__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: var(--radius-small, 8px); }
.history__total { margin-left: auto; font-weight: 600; }
.history__pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 12px; }
.kv dt { color: var(--text-muted-color); }
.kv dd { margin: 0; }
.section-title { font-size: var(--font-heading, 16px); margin: 16px 0 8px; }
.purchase-editor { display: grid; gap: 12px; min-width: 0; }
.purchase-editor__head p { margin: 2px 0; }
.purchase-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.purchase-bar .btn { flex: 1 1 auto; }
.purchase-rates, .purchase-summary { padding: 12px 16px; display: grid; gap: 6px; }
.costsheet { display: grid; gap: 12px; min-width: 0; }
.costsheet-missing, .costsheet-general { padding: 12px 16px; display: grid; gap: 8px; }
.costsheet-general__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tab--on { border-bottom-color: var(--primary-color); font-weight: 600; }
.dialog-actions--start { justify-content: flex-start; }
.costsheet .tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.costsheet .tab { flex: 0 0 auto; flex-direction: row; gap: 6px; padding: 8px 14px; border: 1px solid var(--border-color); border-radius: 999px; background: transparent; }
.costsheet .tab--on { background: var(--primary-color); border-color: var(--primary-color); color: var(--on-primary-text-color); }

/* Barcode scan drawer and the searchable pick-one box. */
.scan { display: grid; gap: 12px; }
.scan__video { width: 100%; aspect-ratio: 4 / 3; max-height: 50dvh; object-fit: cover; background: var(--camera-preview-bg-brush); border-radius: var(--radius-card, 12px); }
.scan__hint { text-align: center; margin: 0; }
.ss__box { position: relative; flex: 1; min-width: 0; }
.ss__box .input { width: 100%; }
.ss__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; margin: 0; padding: 4px; list-style: none;
  max-height: min(280px, 40dvh); overflow-y: auto; background: var(--surface-color); color: var(--text-primary-color);
  border: 1px solid var(--border-color); border-radius: var(--radius-small, 8px); box-shadow: 0 8px 24px color-mix(in srgb, var(--shadow-popup-color) 24%, transparent);
}
.ss__option { min-height: 44px; display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.ss__option--active, .ss__option:hover { background: var(--surface-focus-brush); }
.ss__option[aria-selected="true"] { font-weight: 700; }
.ss__note { padding: 8px 10px; font-size: var(--font-caption, 11px); opacity: .7; }
/* Dashboard, sales, reports and audit (E44 tanda 4). Mobile first: single column, grids reflow with auto-fit. */
.dash { display: grid; gap: 14px; min-width: 0; }
.dash__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dash__link { color: var(--primary-color); font-weight: 700; font-size: var(--font-label, 12px); }
.dash__cta { justify-self: stretch; text-align: center; }
.dash__pending { text-decoration: none; display: block; }
.card__title { margin: 0 0 8px; font-size: var(--font-subheading, 15px); font-weight: 800; }
.dash-kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { display: grid; gap: 2px; padding: 12px 14px; min-width: 0; }
.kpi strong { font-size: var(--font-heading, 22px); font-weight: 800; overflow-wrap: anywhere; }
.kpi--warn strong { color: var(--accent-orange-color); }
.dash-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.dash-grid__wide { grid-column: 1 / -1; }
.dash-banner { display: grid; gap: 8px; background: var(--primary-color); color: var(--on-primary-text-color); border-color: transparent; }
.dash-banner__label { font-size: var(--font-micro, 11px); font-weight: 700; opacity: .8; }
.dash-banner__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.dash-banner__big { font-size: var(--font-heading, 22px); font-weight: 800; }
.dash-list { list-style: none; margin: 0; padding: 0; display: grid; }
.dash-list__item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border-color); min-width: 0; }
.dash-list__item:first-child { border-top: 0; }
.dash-list__item--off { opacity: .55; text-decoration: line-through; }
.dash-list__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dash-actions { display: grid; gap: 8px; margin-bottom: 12px; }
.week-chart { width: 100%; height: auto; display: block; }
.week-chart__axis { stroke: var(--border-color); stroke-width: 1; }
.week-chart__bar { fill: var(--primary-soft-color); }
.week-chart__bar--today { fill: var(--primary-color); }
.week-chart__value { fill: var(--text-secondary-color); font-size: 12px; font-weight: 600; }
.week-chart__day { fill: var(--text-muted-color); font-size: 13px; }
.week-chart__day--today { fill: var(--primary-color); font-weight: 800; }
.report-filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.report-filters__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.shift-row { border: 1px solid var(--border-color); border-radius: var(--radius-input, 10px); padding: 8px 12px; margin: 0 0 10px; min-width: 0; }
/* Reportes hub: one card per report - icon, title and description, the open button aligned at the end. */
.hub-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; }
.hub-card__icon { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-input, 10px); background: var(--primary-light-color); color: var(--primary-color); }
.hub-card__title { margin: 0; font-size: var(--font-subheading, 15px); font-weight: 800; }
.hub-card__text { margin: 0; color: var(--text-secondary-color); }
.hub-card__open { grid-column: 1 / -1; justify-self: stretch; margin-top: 8px; }
.hub-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
@media (min-width: 769px) { .hub-card__open { grid-column: auto; grid-row: 1 / span 2; grid-column-start: 3; justify-self: end; margin-top: 0; } .hub-card { grid-template-columns: auto minmax(0, 1fr) auto; } }
/* Page header: title with a quiet subtitle, actions that wrap under it on a phone instead of overlapping. */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.pagehead__text { display: grid; gap: 2px; min-width: 0; }
.pagehead__sub { margin: 0; }
.pagehead__actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Price list */
.avail-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; padding: 12px 16px; }
.avail-bar .field { margin-bottom: 0; }
.avail-bar__currency { flex: 0 1 160px; min-width: 120px; }
.avail-bar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.avail-name { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.avail-name input { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.avail-name__text { display: grid; gap: 2px; min-width: 0; }
.avail-name__warn { font-weight: 600; font-size: var(--font-caption, 11px); }
.wtable th.avail-price, .wtable td.avail-price { text-align: right; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Login: the remembered-user row */
.auth__remember { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.auth__remember .check { min-height: 36px; }
.auth__notyou { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--primary-color); cursor: pointer; text-decoration: underline; }
.chip--rate { min-height: 0; padding: 4px 12px; font-size: var(--font-caption, 11px); white-space: nowrap; }
.chip--warn { background: var(--warning-light-color); border-color: transparent; color: var(--warning-dark-color); }
.chip--danger-soft { display: inline-block; background: var(--danger-light-color); border-color: transparent; color: var(--danger-dark-color); }
.code-block { margin: 0 0 12px; padding: 10px 12px; max-width: 100%; overflow-x: auto; background: var(--app-background-color); border: 1px solid var(--border-color); border-radius: var(--radius-input, 10px); font-family: var(--font-family-mono, monospace); font-size: var(--font-label, 12px); }
.wrap { overflow-wrap: anywhere; }
.wtable-select { min-width: 0; max-width: 100%; }
.week-chart { max-height: 240px; }
.pay-sum { margin: 0 0 8px; display: grid; gap: 4px; }
.pay-sum > div { display: flex; justify-content: space-between; gap: 12px; }
.pay-sum dt { color: var(--text-secondary-color); }
.pay-sum dd { margin: 0; text-align: right; font-weight: 700; }
.pay-sum__ref { font-size: var(--font-caption, 12px); }
.pay-sum__ref dt { color: var(--text-muted-color); }
.pay-sum__ref dd { font-weight: 600; overflow-wrap: anywhere; user-select: all; }
.dash-list__item small { overflow-wrap: anywhere; }

/* Settings, users and roles, the license page (E44 tanda 5). One column on a phone; two cards side by side from 1024 px. */
.settings__tabs, .page__tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.settings__body { display: grid; gap: 16px; min-width: 0; }
.settings__card { display: grid; gap: 12px; min-width: 0; }
.settings__card .field { margin: 0; min-width: 0; }
.settings .input { max-width: 100%; }
@media (min-width: 1024px) {
  .settings__body:has(> .settings__card + .settings__card) { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.license { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; min-width: 0; }
.license dt { color: var(--text-secondary-color, inherit); }
.license dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.license .chips { flex-wrap: wrap; overflow: visible; }
.roles { min-width: 0; }
.roles__new { display: flex; gap: 8px; align-items: end; }
.roles__new .field { flex: 1; margin: 0; }
.roles__list { flex-wrap: wrap; }
.roles__perms { display: grid; gap: 4px; max-height: 50dvh; overflow-y: auto; }

/* The notification bell (E44 tanda 5). The menu hangs from the bell and the host keeps it on screen. */
.notif { position: relative; }
.notif__count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger-dark-color); color: var(--on-primary-text-color); font-size: 11px; line-height: 16px; text-align: center; }
.notif__panel { width: 320px; }
.notif__item { display: grid; gap: 2px; text-align: left; }
.notif__empty { margin: 8px 12px; }

/* Dropdown menus (FloatingMenu): fixed, so no table or card clips them; hidden until the host has placed them
   (benito.menu in benito.js sets top/left, keeps them in the window and scrolls them inside when too tall). */
.fmenu { position: fixed; top: 0; left: 0; right: auto; visibility: hidden; z-index: 60; max-width: calc(100vw - 16px); overflow-y: auto; }

/* Connection notices (ConnectionNotices.razor): hidden until Blazor marks the element with a state class. */
.conn {
  display: none; position: fixed; inset: auto 0 0 0; z-index: 1000; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; background: var(--danger-light-color); color: var(--danger-dark-color);
  border-top: 1px solid var(--danger-dark-color); font-family: inherit;
}
.conn__text { margin: 0; font-weight: 600; flex: 1 1 240px; display: none; }
.conn__reload { display: none; }
.conn.components-reconnect-show,
.conn.components-reconnect-retrying,
.conn.components-reconnect-failed,
.conn.components-reconnect-rejected,
.conn.components-reconnect-paused { display: flex; }
.conn.components-reconnect-show .conn__text--lost,
.conn.components-reconnect-retrying .conn__text--lost,
.conn.components-reconnect-failed .conn__text--failed,
.conn.components-reconnect-paused .conn__text--lost,
.conn.components-reconnect-rejected .conn__text--rejected { display: block; }
.conn.components-reconnect-failed .conn__reload,
.conn.components-reconnect-rejected .conn__reload { display: inline-block; }
#blazor-error-ui.conn--error .conn__text, #blazor-error-ui.conn--error .conn__reload, #blazor-error-ui.conn--error .conn__dismiss { display: inline-block; }

/* ---- Organize mode of the counter and the catalogue (W3 parity): per-card tools, 44 px each ---- */
.pos-tools { display: flex; justify-content: flex-end; }
.pos-arrange-hint { margin: 0; }
.pos-grid--arranging { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pos-card--arranging { cursor: default; }
.pos-card--arranging[draggable="true"] { cursor: grab; }
.pos-card--arranging .pos-card__photo { aspect-ratio: 16 / 5; }
.pos-card__pinned { justify-self: start; margin-left: 0; }
.pos-card__tools, .row-order { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.arrange-btn { width: 44px; min-width: 44px; min-height: 44px; border: 1px solid var(--border-color); background: var(--surface-color); color: var(--text-primary-color); font: inherit; font-size: 18px; cursor: pointer; }
.arrange-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.arrange-btn--on { background: var(--primary-light-color); border-color: var(--primary-color); color: var(--primary-color); }
.wtable__row--over td { background: var(--primary-light-color); }
.alert--info { background: var(--primary-light-color); color: var(--primary-color); }

/* A row that opens its details (WebDataTable.RowCommand): the whole row is pressable and focusable. */
.wtable__row--link { cursor: pointer; }
.wtable__row--link:hover td { background: var(--primary-light-color); }
.wtable__row--link:focus-visible { outline: 2px solid var(--primary-color); outline-offset: -2px; }
.wtable__row--link .wtable__actions { cursor: default; }

.side-link, .tab, .sheet-link { position: relative; }
.nav-badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger-dark-color); color: var(--on-primary-text-color); font-size: 11px; line-height: 16px; text-align: center; }
.side-link .nav-badge, .sheet-link .nav-badge { margin-left: auto; }
.tab .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); }
