:root {
  --bg: #f7f7f4;
  --panel: #ffffff;
  --panel-2: #f0f0ec;
  --ink: #17191d;
  --muted: #62666d;
  --line: #e4e2da;
  --brand: #9a6d05;
  --brand-dark: #755200;
  --accent: #b42318;
  --gold: #e2a924;
  --gold-dark: #8a6300;
  --gold-soft: #fff8df;
  --ok: #138a43;
  --radius: 8px;
  --shadow: 0 10px 28px rgba(24, 24, 24, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Touch-first restaurant POS */
.pos-service-bar {
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.45fr);
  gap: 10px;
}

.pos-service-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.pos-service-types button,
.pos-order-context {
  min-height: 62px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.pos-service-types button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 800;
}

.pos-service-types button svg {
  width: 23px;
  height: 23px;
}

.pos-service-types button.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #18150d;
  box-shadow: inset 0 -3px 0 rgba(24, 21, 13, 0.2);
}

.pos-order-context {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.pos-order-context.ready {
  border-color: rgba(226, 169, 36, 0.72);
}

.pos-order-context > svg:first-child {
  width: 25px;
  height: 25px;
  color: var(--gold-dark);
}

.pos-order-context > svg:last-child {
  width: 18px;
  height: 18px;
}

.pos-order-context span {
  min-width: 0;
}

.pos-order-context strong,
.pos-order-context small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-order-context strong {
  font-size: 14px;
}

.pos-order-context small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.pos-catalog-surface {
  display: flex;
  height: clamp(580px, calc(100dvh - 232px), 790px);
  flex-direction: column;
}

.pos-catalog-surface .pos-products {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pos-catalog-surface .pos-category-filters {
  min-height: 68px;
  margin: 10px -14px -14px;
  padding: 7px 10px;
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: var(--panel);
  scrollbar-width: thin;
}

.pos-catalog-surface .pos-category-filters button {
  min-width: 104px;
  min-height: 52px;
  padding: 7px 12px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.pos-catalog-surface .pos-category-filters button.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #18150d;
}

.pos-catalog-surface .pos-category-filters button svg,
.pos-catalog-surface .pos-category-filters .pos-category-dot {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.pos-catalog-surface .pos-category-filters .pos-category-dot {
  border-radius: 4px;
  background: var(--category-color);
}

.pos-catalog-toolbar .pos-keyboard-trigger,
.pos-catalog-toolbar .icon-segmented button,
.pos-catalog-toolbar .pos-scan-button {
  min-width: 48px;
  min-height: 48px;
}

.pos-catalog-toolbar .pos-search {
  min-height: 48px;
}

.pos-catalog-toolbar .pos-search input {
  min-height: 46px;
  font-size: 14px;
}

.pos-products .pos-product {
  min-height: 196px;
}

.pos-products .pos-product-media {
  height: 122px;
}

.pos-products .pos-product-price {
  padding: 5px 8px;
  font-size: 13px;
}

.pos-products .pos-product-copy strong {
  font-size: 14px;
}

.pos-cart {
  height: clamp(580px, calc(100dvh - 232px), 790px);
}

.pos-ticket-head .icon-button,
.pos-ticket-customer .icon-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
}

.pos-ticket-customer {
  min-height: 58px;
  grid-template-columns: 22px minmax(0, 1fr) 46px;
}

.pos-ticket-customer select {
  min-height: 44px;
  font-size: 13px;
}

.pos-cart .cart-line {
  min-height: 68px;
}

.pos-cart .quantity-stepper {
  grid-template-columns: 38px 34px 38px;
}

.pos-cart .quantity-stepper button {
  width: 38px;
  height: 38px;
}

.restaurant-order-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.restaurant-order-actions button {
  min-width: 0;
  min-height: 52px;
  padding: 6px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  font-size: 10px;
}

.restaurant-order-actions button:last-child {
  border-right: 0;
}

.restaurant-order-actions svg {
  width: 17px;
  height: 17px;
}

.pos-ticket-actions > button {
  min-height: 72px;
  font-size: 14px;
}

.pos-ticket-actions .pos-pay strong {
  font-size: 18px;
}

.pos-orders-modal {
  width: min(920px, calc(100vw - 24px));
}

.pos-orders-modal .modal-inner {
  max-height: min(880px, calc(100dvh - 24px));
  overflow: hidden;
}

.pos-orders-tabs {
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f5;
}

.pos-orders-tabs button {
  min-height: 52px;
  font-size: 13px;
}

.pos-orders-tabs button.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #18150d;
}

.pos-orders-content {
  min-height: 320px;
  max-height: 62dvh;
  padding: 14px;
  overflow-y: auto;
}

.pos-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.pos-table-card {
  position: relative;
  min-height: 132px;
  padding: 15px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  text-align: left;
}

.pos-table-card.available {
  border-color: #9bb9a2;
}

.pos-table-card.occupied {
  border-color: var(--gold);
  background: #fffaf0;
}

.pos-table-card.active {
  box-shadow: 0 0 0 3px rgba(226, 169, 36, 0.24);
}

.pos-table-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #eef3ed;
  color: #356543;
}

.pos-table-card.occupied .pos-table-card-icon {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.pos-table-card-copy strong,
.pos-table-card-copy small,
.pos-table-card-copy span {
  display: block;
}

.pos-table-card-copy strong {
  font-size: 17px;
}

.pos-table-card-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.pos-table-card-copy span {
  margin-top: 9px;
  font-size: 12px;
  font-weight: 750;
}

.pos-table-card-total {
  position: absolute;
  right: 13px;
  bottom: 12px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.pos-open-order-card {
  width: 100%;
  min-height: 76px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  text-align: left;
}

.pos-open-order-card > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.pos-open-order-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.pos-open-order-card.local > button:not(.icon-button) {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.pos-name-modal {
  width: min(560px, calc(100vw - 24px));
}

.pos-name-modal .modal-inner {
  padding: 24px;
}

.pos-name-input {
  margin: 18px 0;
}

.pos-name-input input {
  min-height: 58px;
  font-size: 22px;
  font-weight: 800;
}

.pos-name-input .icon-button {
  width: 58px;
  height: 58px;
}

.pos-split-modal {
  width: min(690px, calc(100vw - 24px));
}

.pos-split-lines {
  max-height: 55dvh;
  overflow-y: auto;
}

.pos-split-line {
  min-height: 76px;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 100px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.pos-split-line small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.pos-split-line > strong {
  text-align: right;
}

.quantity-stepper.large {
  grid-template-columns: 46px 40px 46px;
}

.quantity-stepper.large button {
  width: 46px;
  height: 46px;
}

.pos-split-total {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  background: #f7f7f5;
}

.pos-split-total strong {
  font-size: 25px;
}

.pos-keyboard-modal {
  width: min(940px, calc(100vw - 20px));
}

.pos-keyboard-modal .modal-inner {
  padding: 14px;
}

.pos-keyboard-display {
  min-height: 62px;
  margin-bottom: 12px;
  font-size: 25px;
  font-weight: 800;
}

.pos-keyboard-keys {
  display: grid;
  gap: 7px;
}

.pos-keyboard-keys > div {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.pos-keyboard-keys button {
  width: clamp(46px, 8vw, 76px);
  min-width: 0;
  min-height: 56px;
  padding: 5px;
  font-size: 18px;
  font-weight: 850;
}

.pos-keyboard-keys .space {
  width: min(360px, 44vw);
}

.pos-success-actions {
  grid-template-columns: repeat(3, 1fr);
}

body.pos-fullscreen .pos-recent-sales {
  display: none;
}

body.pos-fullscreen .pos-catalog-surface,
body.pos-fullscreen .pos-cart {
  height: calc(100dvh - 150px);
  min-height: calc(100dvh - 150px);
  max-height: calc(100dvh - 150px);
}

body.dark .pos-orders-tabs,
body.dark .pos-split-total,
body.dark .pos-table-card,
body.dark .pos-open-order-card,
body.dark .pos-service-types button,
body.dark .pos-order-context,
body.dark .pos-catalog-surface .pos-category-filters,
body.dark .pos-catalog-surface .pos-category-filters button {
  background: var(--panel-2);
}

@media (max-width: 900px) {
  .pos-service-bar {
    grid-template-columns: 1fr;
  }

  .pos-catalog-surface,
  .pos-cart {
    height: auto;
  }

  .pos-catalog-surface .pos-products {
    min-height: 480px;
  }

  .pos-orders-modal {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .pos-orders-modal .modal-inner {
    min-height: 100dvh;
    max-height: 100dvh;
  }

  .pos-orders-content {
    max-height: none;
    flex: 1 1 auto;
  }
}

@media (max-width: 640px) {
  .pos-service-types button {
    min-height: 58px;
    padding: 6px;
    font-size: 10px;
  }

  .pos-service-types button {
    display: grid;
    place-items: center;
    gap: 4px;
  }

  .pos-service-types button svg {
    width: 21px;
    height: 21px;
  }

  .pos-toolbar-actions {
    grid-template-columns: minmax(0, 1fr) 48px 48px 48px;
  }

  .pos-catalog-surface .pos-category-filters {
    margin-right: -10px;
    margin-left: -10px;
  }

  .pos-products .pos-product {
    min-height: 184px;
  }

  .pos-products .pos-product-media {
    height: 112px;
  }

  .pos-table-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-table-card {
    min-height: 140px;
    padding: 11px;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .pos-table-card-icon {
    width: 34px;
    height: 34px;
  }

  .pos-table-card-copy strong {
    font-size: 14px;
  }

  .pos-split-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pos-split-line > strong {
    grid-column: 1 / -1;
  }

  .pos-keyboard-modal {
    width: 100vw;
    max-width: none;
    margin: auto 0 0;
    border-radius: 0;
  }

  .pos-keyboard-keys button {
    min-height: 48px;
    font-size: 14px;
  }

  .pos-success-actions {
    grid-template-columns: 1fr;
  }
}

/* POS verification fixes: viewport fit, compact toolbar and reliable mobile panels. */
#view-sales .pos-loyverse-shell .pos-layout {
  min-height: 520px;
}

#view-sales .pos-loyverse-shell .pos-layout > .pos-catalog-surface,
#view-sales .pos-loyverse-shell .pos-cart {
  min-height: 520px;
}

#view-sales .pos-loyverse-shell .pos-catalog-toolbar > div:first-child {
  min-width: 142px;
  flex: 0 0 142px;
}

#view-sales .pos-loyverse-shell .pos-catalog-toolbar h2 {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-sales .pos-loyverse-shell .pos-search {
  width: 220px;
  min-width: 160px;
}

.modal.pos-checkout-modal .pos-checkout-pane {
  padding-bottom: 92px;
}

.modal.pos-checkout-modal .pos-checkout-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 31%;
  z-index: 8;
  margin: 0;
}

@media (max-width: 1600px) {
  #view-sales .pos-loyverse-shell .pos-catalog-toolbar .icon-segmented {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-scan-button span {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 52px;
  }
}

@media (max-width: 900px) {
  #view-sales .pos-loyverse-shell .pos-layout.mobile-catalog > .pos-catalog-surface {
    display: grid;
  }

  #view-sales .pos-loyverse-shell .pos-layout.mobile-catalog > .pos-cart {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-layout.mobile-cart > .pos-catalog-surface {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-layout.mobile-cart > .pos-cart {
    display: flex;
  }

  .modal.pos-checkout-modal .pos-checkout-actions {
    left: 0;
  }
}

@media (max-width: 640px) {
  #view-sales .pos-loyverse-shell .pos-catalog-toolbar > div:first-child {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-toolbar-actions {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  #view-sales .pos-loyverse-shell .pos-layout > .pos-catalog-surface,
  #view-sales .pos-loyverse-shell .pos-cart {
    height: calc(100dvh - 230px);
    min-height: 480px;
  }
}

/* POS tactile: final layout and order screens */
#view-sales .pos-catalog-toolbar .pos-toolbar-actions {
  flex-wrap: nowrap;
}

#view-sales .pos-catalog-toolbar .icon-segmented {
  width: 106px;
  min-width: 106px;
  height: 50px;
  min-height: 50px;
  grid-template-columns: repeat(2, 52px);
}

#view-sales .pos-catalog-toolbar .icon-segmented button {
  width: 52px;
  min-width: 52px;
  height: 48px;
  min-height: 48px;
  padding: 0;
}

#view-sales .pos-catalog-surface .pos-category-filters {
  min-height: 72px;
  padding: 8px 12px;
  gap: 8px;
}

#view-sales .pos-catalog-surface .pos-category-filters button {
  width: auto;
  min-width: 142px;
  max-width: 210px;
  min-height: 54px;
  padding: 8px 16px;
  white-space: nowrap;
}

#view-sales .pos-catalog-surface .pos-category-filters button span:last-child {
  width: auto;
  height: auto;
  margin: 0;
  display: block;
  flex: 1 1 auto;
  border-radius: 0;
  background: transparent;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-sales .restaurant-order-actions.single {
  grid-template-columns: 1fr;
}

#view-sales .restaurant-order-actions.single button {
  min-height: 54px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

#view-sales .pos-guest-field {
  margin: 0;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#view-sales .pos-guest-field input {
  min-height: 46px;
  text-align: center;
  font-size: 17px;
  font-weight: 900;
}

.pos-orders-modal {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.pos-orders-modal::backdrop {
  background: var(--panel);
}

.pos-orders-modal .modal-inner {
  width: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  padding: 22px 28px 18px;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border-radius: 0;
}

.pos-orders-modal .modal-head {
  flex: 0 0 auto;
}

.pos-orders-modal .pos-orders-content {
  min-height: 0;
  max-height: none;
  padding: 18px 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.pos-orders-modal .modal-actions {
  position: static;
  margin: 0;
  padding: 14px 0 0;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.pos-open-order-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}

.pos-open-order-card {
  min-height: 146px;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto 20px;
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafaf8;
}

.pos-open-order-number {
  position: static;
  width: auto;
  height: auto;
  display: block;
  grid-column: 1 / 3;
  place-items: initial;
  border-radius: 0;
  background: transparent;
  color: var(--gold-dark);
  font-size: 23px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.pos-open-order-card > .badge {
  position: static;
  width: auto;
  height: 26px;
  padding: 4px 9px;
  display: inline-flex;
  grid-column: 3 / 5;
  justify-self: end;
  border-radius: 999px;
  white-space: nowrap;
}

.pos-open-order-icon {
  width: 50px;
  height: 50px;
  grid-column: 1;
  grid-row: 2;
}

.pos-open-order-icon svg {
  width: 25px;
  height: 25px;
}

.pos-open-order-copy {
  min-width: 0;
  grid-column: 2;
  grid-row: 2;
}

.pos-open-order-copy strong,
.pos-open-order-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-open-order-copy strong {
  font-size: 17px;
}

.pos-open-order-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.pos-open-order-total {
  grid-column: 3;
  grid-row: 2;
  font-size: 18px;
  white-space: nowrap;
}

.pos-open-order-card > svg:last-child {
  grid-column: 4;
  grid-row: 2;
}

.pos-keyboard-modal[data-keyboard-mode="numeric"] .pos-keyboard-keys > div:nth-child(2),
.pos-keyboard-modal[data-keyboard-mode="numeric"] .pos-keyboard-keys > div:nth-child(3),
.pos-keyboard-modal[data-keyboard-mode="numeric"] .pos-keyboard-keys > div:nth-child(4) {
  display: none;
}

@media (max-width: 720px) {
  #view-sales .pos-catalog-toolbar .pos-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 106px 52px;
  }

  #view-sales .pos-catalog-toolbar .pos-search {
    grid-column: 1 / -1;
  }

  #view-sales .pos-catalog-surface .pos-category-filters button {
    min-width: 116px;
    max-width: 156px;
    padding: 7px 11px;
  }

  .pos-orders-modal .modal-inner {
    padding: 14px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .pos-open-order-grid {
    grid-template-columns: 1fr;
  }

  .pos-open-order-card {
    min-height: 132px;
    padding: 14px;
    grid-template-columns: 44px minmax(0, 1fr) auto 18px;
    gap: 9px;
  }

  .pos-open-order-number {
    font-size: 20px;
  }

  .pos-open-order-icon {
    width: 44px;
    height: 44px;
  }

  .pos-open-order-total {
    font-size: 15px;
  }
}

/* POS 2026: immersive touch workspace inspired by dedicated tablet registers. */
.pos-loyverse-shell {
  --pos-bg: #202225;
  --pos-panel: #2b2d31;
  --pos-panel-raised: #34363b;
  --pos-line: #44474d;
  --pos-text: #f6f6f3;
  --pos-muted: #aeb1b7;
  overflow: hidden;
  border: 1px solid #303238;
  border-radius: 7px;
  background: var(--pos-bg);
  color: var(--pos-text);
  box-shadow: 0 16px 40px rgba(20, 20, 18, 0.14);
}

#view-sales .pos-loyverse-shell .pos-order-launchbar {
  min-height: 68px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--pos-line);
  border-radius: 0;
  background: #292b2f;
}

#view-sales .pos-loyverse-shell .pos-primary-order-actions {
  grid-template-columns: repeat(2, minmax(176px, 236px));
}

#view-sales .pos-loyverse-shell .pos-primary-order-actions > button {
  min-height: 50px;
  border-color: var(--pos-line);
  background: var(--pos-panel-raised);
  color: var(--pos-text);
}

#view-sales .pos-loyverse-shell .pos-primary-order-actions > button.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #18150d;
}

#view-sales .pos-loyverse-shell .pos-sync-state {
  border-color: transparent;
  background: transparent;
  color: #b7d3bd;
}

#view-sales .pos-loyverse-shell .pos-fullscreen-button {
  min-height: 50px;
  border-color: var(--pos-line);
  background: var(--pos-panel-raised);
  color: var(--pos-text);
}

#view-sales .pos-loyverse-shell .pos-layout {
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(380px, 0.72fr);
  gap: 1px;
  align-items: stretch;
  background: var(--pos-line);
}

#view-sales .pos-loyverse-shell .pos-layout > .pos-catalog-surface {
  height: clamp(660px, calc(100dvh - 205px), 850px);
  min-height: 660px;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--pos-bg);
}

#view-sales .pos-loyverse-shell .pos-catalog-toolbar {
  min-height: 74px;
  margin: 0;
  padding: 10px 12px;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--pos-line);
  background: #292b2f;
}

#view-sales .pos-loyverse-shell .pos-catalog-toolbar h2 {
  color: var(--pos-text);
  font-size: 21px;
}

#view-sales .pos-loyverse-shell .pos-catalog-toolbar > div:first-child > span {
  color: var(--pos-muted);
}

#view-sales .pos-loyverse-shell .pos-search {
  min-height: 50px;
  border-color: var(--pos-line);
  background: var(--pos-panel-raised);
}

#view-sales .pos-loyverse-shell .pos-search input {
  color: var(--pos-text);
}

#view-sales .pos-loyverse-shell .pos-search input::placeholder {
  color: var(--pos-muted);
}

#view-sales .pos-loyverse-shell .icon-segmented,
#view-sales .pos-loyverse-shell .pos-scan-button {
  border-color: var(--pos-line);
  background: var(--pos-panel-raised);
  color: var(--pos-text);
}

#view-sales .pos-loyverse-shell .icon-segmented button {
  border-color: var(--pos-line);
  background: transparent;
  color: var(--pos-muted);
}

#view-sales .pos-loyverse-shell .icon-segmented button.active {
  background: var(--gold);
  color: #18150d;
}

#view-sales .pos-loyverse-shell .pos-products {
  min-height: 0;
  max-height: none;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  grid-auto-rows: 158px;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  background: var(--pos-bg);
}

#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product {
  position: relative;
  height: 158px;
  min-height: 158px;
  display: block;
  overflow: hidden;
  border: 1px solid #4a4c50;
  border-radius: 4px;
  background: var(--pos-panel-raised);
  box-shadow: none;
}

#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product:active:not(:disabled) {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold);
  transform: scale(0.985);
}

#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product-media {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #3b3d42;
}

#view-sales .pos-loyverse-shell .pos-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product-media > svg {
  width: 42px;
  height: 42px;
  color: #85888e;
}

#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product-copy {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 54px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 3px 8px;
  background: rgba(24, 25, 27, 0.88);
  color: #fff;
  text-align: left;
}

#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product-copy strong {
  min-height: 0;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  color: #fff;
  font-size: 13px;
}

#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product-copy .pos-category,
#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product-copy small:last-child {
  display: none;
}

#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product-price {
  right: 7px;
  top: 7px;
  bottom: auto;
  background: rgba(24, 25, 27, 0.9);
  font-size: 12px;
}

#view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product-list-price {
  display: none;
}

#view-sales .pos-loyverse-shell .pos-products.view-list {
  display: block;
  padding: 0;
}

#view-sales .pos-loyverse-shell .pos-products.view-list .pos-product {
  width: 100%;
  min-height: 76px;
  border: 0;
  border-bottom: 1px solid var(--pos-line);
  border-radius: 0;
  background: var(--pos-panel);
  color: var(--pos-text);
  box-shadow: none;
}

#view-sales .pos-loyverse-shell .pos-products.view-list .pos-product-media {
  width: 76px;
  height: 76px;
  border-radius: 0;
}

#view-sales .pos-loyverse-shell .pos-products.view-list .pos-product-copy strong {
  color: var(--pos-text);
  font-size: 15px;
}

#view-sales .pos-loyverse-shell .pos-products.view-list .pos-product-list-price {
  color: var(--gold);
  font-size: 15px;
}

#view-sales .pos-loyverse-shell .pos-catalog-surface .pos-category-filters {
  position: static;
  min-height: 76px;
  max-width: none;
  margin: 0;
  padding: 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border: 0;
  border-top: 1px solid var(--pos-line);
  border-radius: 0;
  background: #292b2f;
  box-shadow: none;
}

#view-sales .pos-loyverse-shell .pos-catalog-surface .pos-category-filters button {
  min-width: 132px;
  max-width: 180px;
  min-height: 58px;
  padding: 8px 12px;
  border-color: var(--pos-line);
  background: var(--pos-panel-raised);
  color: var(--pos-text);
}

#view-sales .pos-loyverse-shell .pos-catalog-surface .pos-category-filters button.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #18150d;
  box-shadow: none;
}

#view-sales .pos-loyverse-shell .pos-cart {
  position: relative;
  top: 0;
  height: clamp(660px, calc(100dvh - 205px), 850px);
  min-height: 660px;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: var(--pos-panel);
  color: var(--pos-text);
  box-shadow: none;
}

#view-sales .pos-loyverse-shell .pos-ticket-head {
  min-height: 86px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--pos-line);
  background: #292b2f;
}

#view-sales .pos-loyverse-shell .pos-ticket-order-number {
  color: var(--gold);
  font-size: 22px;
}

#view-sales .pos-loyverse-shell .pos-ticket-head h2 {
  color: var(--pos-text);
}

#view-sales .pos-loyverse-shell .pos-ticket-head p {
  color: var(--pos-muted);
}

#view-sales .pos-loyverse-shell .pos-ticket-head .icon-button,
#view-sales .pos-loyverse-shell .pos-ticket-context button {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-color: var(--pos-line);
  background: var(--pos-panel-raised);
  color: var(--pos-text);
}

.pos-ticket-menu {
  position: relative;
}

.pos-ticket-menu summary {
  display: grid;
  place-items: center;
  list-style: none;
  cursor: pointer;
}

.pos-ticket-menu summary::-webkit-details-marker {
  display: none;
}

.pos-ticket-menu > div {
  position: absolute;
  z-index: 20;
  top: 54px;
  right: 0;
  width: 250px;
  padding: 6px;
  display: grid;
  border: 1px solid var(--pos-line);
  border-radius: 6px;
  background: #35373c;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.pos-ticket-menu > div button {
  min-height: 52px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--pos-text);
  text-align: left;
}

.pos-ticket-menu > div button:hover {
  background: #44474d;
}

.pos-ticket-context {
  min-height: 66px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--pos-line);
  background: #303237;
}

.pos-ticket-context > span:first-child {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(226, 169, 36, 0.14);
  color: var(--gold);
}

.pos-ticket-context > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.pos-ticket-context strong,
.pos-ticket-context small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-ticket-context small {
  color: var(--pos-muted);
}

#view-sales .pos-loyverse-shell .pos-cart .cart-lines {
  background: var(--pos-panel);
}

#view-sales .pos-loyverse-shell .pos-cart .cart-lines > .empty {
  color: var(--pos-muted);
}

#view-sales .pos-loyverse-shell .pos-cart .cart-line {
  min-height: 78px;
  grid-template-columns: minmax(0, 1fr) auto auto 42px;
  gap: 8px;
  border-bottom-color: var(--pos-line);
  background: var(--pos-panel);
  color: var(--pos-text);
}

#view-sales .pos-loyverse-shell .pos-cart .cart-line > div:first-child span {
  color: var(--pos-muted);
}

#view-sales .pos-loyverse-shell .quantity-stepper {
  grid-template-columns: 34px 30px 34px;
}

#view-sales .pos-loyverse-shell .quantity-stepper button {
  width: 34px;
  height: 40px;
  border-color: var(--pos-line);
  background: var(--pos-panel-raised);
  color: var(--pos-text);
}

#view-sales .pos-loyverse-shell .cart-line .danger-icon {
  width: 40px;
  height: 40px;
  border-color: var(--pos-line);
  background: transparent;
}

#view-sales .pos-loyverse-shell .pos-summary {
  padding: 12px 14px;
  border-top-color: var(--pos-line);
  background: #292b2f;
}

#view-sales .pos-loyverse-shell .pos-summary div {
  color: var(--pos-muted);
}

#view-sales .pos-loyverse-shell .pos-summary strong,
#view-sales .pos-loyverse-shell .pos-summary .grand {
  color: var(--pos-text);
}

#view-sales .pos-loyverse-shell .pos-ticket-actions {
  border-top-color: var(--pos-line);
}

#view-sales .pos-loyverse-shell .pos-ticket-actions > button {
  min-height: 76px;
  border-right-color: var(--pos-line);
  background: #34363b;
  color: var(--pos-text);
  font-size: 15px;
}

#view-sales .pos-loyverse-shell .pos-ticket-actions > .pos-pay {
  background: var(--gold);
  color: #18150d;
}

#view-sales .pos-loyverse-shell .pos-register-state {
  min-height: 36px;
  border-top-color: var(--pos-line);
  background: #24262a;
}

#view-sales .pos-loyverse-shell .restaurant-order-actions.single {
  display: none;
}

#view-sales .pos-loyverse-shell .pos-recent-sales {
  display: none;
}

body.pos-fullscreen #view-sales .pos-loyverse-shell {
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
}

body.pos-fullscreen #view-sales .pos-loyverse-shell .pos-layout > .pos-catalog-surface,
body.pos-fullscreen #view-sales .pos-loyverse-shell .pos-cart {
  height: calc(100dvh - 68px);
  min-height: calc(100dvh - 68px);
  max-height: calc(100dvh - 68px);
}

body.pos-fullscreen #view-sales .pos-loyverse-shell .pos-order-launchbar {
  position: static;
  margin: 0;
}

.modal.pos-client-modal {
  position: fixed;
  inset: var(--pos-workspace-top, 0px) 12vw 0 18vw;
  width: auto;
  max-width: none;
  height: calc(100dvh - var(--pos-workspace-top, 0px));
  max-height: none;
  margin: 0;
  border: 1px solid #44474d;
  border-bottom: 0;
  border-radius: 0;
  background: #2b2d31;
  color: #f6f6f3;
}

.modal.pos-client-modal::backdrop {
  background: rgba(12, 13, 15, 0.68);
}

.modal.pos-client-modal .modal-inner {
  width: 100%;
  min-height: 100%;
  max-height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  background: #2b2d31;
}

.modal.pos-client-modal .modal-head {
  min-height: 82px;
  padding: 14px 20px;
  justify-content: flex-start;
  gap: 14px;
  border-bottom: 1px solid #44474d;
}

.modal.pos-client-modal .modal-head h2 {
  color: #f6f6f3;
}

.modal.pos-client-modal .modal-head .icon-button {
  order: -1;
  border-color: #4b4d53;
  background: #34363b;
  color: #fff;
}

.pos-client-search {
  min-height: 72px;
  padding: 10px 22px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #44474d;
  color: #aeb1b7;
}

.pos-client-search input {
  min-height: 50px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  box-shadow: none;
}

.pos-client-create {
  min-height: 78px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid #44474d;
  background: #303237;
  color: var(--gold);
  text-transform: uppercase;
}

.pos-client-create span {
  display: grid;
  gap: 2px;
  text-align: left;
}

.pos-client-create small {
  color: #aeb1b7;
  text-transform: none;
}

.pos-client-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.pos-client-row {
  width: 100%;
  min-height: 76px;
  padding: 10px 22px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid #44474d;
  border-radius: 0;
  background: transparent;
  color: #f6f6f3;
  text-align: left;
}

.pos-client-row.active {
  background: rgba(226, 169, 36, 0.1);
}

.pos-client-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #414349;
  color: var(--gold);
  font-weight: 900;
}

.pos-client-row > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pos-client-row strong,
.pos-client-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-client-row small {
  color: #aeb1b7;
}

.modal.pos-orders-modal,
.modal.pos-split-modal,
.modal.pos-checkout-modal {
  background: #202225;
  color: #f6f6f3;
}

.modal.pos-orders-modal .modal-inner,
.modal.pos-split-modal .modal-inner,
.modal.pos-checkout-modal .modal-inner {
  background: #202225;
  color: #f6f6f3;
}

.modal.pos-orders-modal .modal-head,
.modal.pos-split-modal .modal-head,
.modal.pos-checkout-modal .modal-head {
  border-bottom: 1px solid #44474d;
  background: #2b2d31;
}

.modal.pos-orders-modal .modal-head h2,
.modal.pos-split-modal .modal-head h2,
.modal.pos-checkout-modal .modal-head h2 {
  color: #f6f6f3;
}

.modal.pos-orders-modal .modal-head .field-hint,
.modal.pos-split-modal .modal-head .field-hint,
.modal.pos-checkout-modal .modal-head .field-hint {
  color: #aeb1b7;
}

.pos-orders-toolbar {
  min-height: 66px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pos-orders-sort {
  display: flex;
  gap: 1px;
  border: 1px solid #44474d;
}

.pos-orders-sort button {
  min-width: 112px;
  min-height: 52px;
  border: 0;
  border-radius: 0;
  background: #34363b;
  color: #c3c5ca;
}

.pos-orders-sort button.active {
  background: var(--gold);
  color: #18150d;
}

.pos-orders-search {
  width: min(360px, 42vw);
  min-height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #44474d;
  background: #34363b;
  color: #aeb1b7;
}

.pos-orders-search input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.modal.pos-orders-modal .pos-orders-new-order {
  border-color: var(--gold);
  background: rgba(226, 169, 36, 0.1);
  color: #f6f6f3;
}

.modal.pos-orders-modal .pos-orders-new-order small {
  color: #b8bac0;
}

.modal.pos-orders-modal .pos-open-order-card {
  border-color: #44474d;
  background: #2b2d31;
  color: #f6f6f3;
}

.modal.pos-orders-modal .pos-open-order-copy {
  color: #f6f6f3;
}

.modal.pos-orders-modal .pos-open-order-copy small {
  color: #aeb1b7;
}

.modal.pos-orders-modal .pos-held-empty {
  color: #aeb1b7;
}

.modal.pos-orders-modal .modal-actions,
.modal.pos-split-modal .modal-actions {
  border-top-color: #44474d;
  background: #202225;
}

.modal.pos-checkout-modal .modal-inner {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(300px, 31%) minmax(0, 1fr);
  overflow: hidden;
}

.pos-checkout-ticket-summary {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #44474d;
  background: #2b2d31;
}

.pos-checkout-ticket-head {
  min-height: 118px;
  padding: 20px;
  border-bottom: 1px solid #44474d;
}

.pos-checkout-ticket-head > span {
  color: var(--gold);
  font-size: 20px;
  font-weight: 900;
}

.pos-checkout-ticket-head h2 {
  margin: 7px 0 4px;
  color: #fff;
  font-size: 21px;
}

.pos-checkout-ticket-head small {
  color: #aeb1b7;
}

.pos-checkout-ticket-lines {
  min-height: 0;
  padding: 4px 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.pos-checkout-ticket-lines > div {
  min-height: 70px;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #3f4146;
}

.pos-checkout-ticket-lines span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pos-checkout-ticket-lines small {
  color: #aeb1b7;
}

.pos-checkout-ticket-totals {
  padding: 16px 18px;
  border-top: 1px solid #44474d;
}

.pos-checkout-ticket-totals > div {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pos-checkout-ticket-totals .grand {
  min-height: 48px;
  margin-top: 8px;
  border-top: 1px solid #55585e;
  font-size: 22px;
}

.pos-checkout-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #202225;
}

.modal.pos-checkout-modal .pos-checkout-pane > .modal-head {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 78px;
  padding: 12px 20px;
  display: flex;
  justify-content: flex-start;
  gap: 14px;
}

.modal.pos-checkout-modal .pos-checkout-total {
  min-height: 126px;
  margin: 0;
  padding: 20px 28px;
  border: 0;
  border-bottom: 1px solid #44474d;
  border-radius: 0;
  background: #2b2d31;
}

.modal.pos-checkout-modal .pos-checkout-total span {
  color: #aeb1b7;
}

.modal.pos-checkout-modal .pos-checkout-total strong {
  color: #fff;
  font-size: 48px;
}

.modal.pos-checkout-modal .pos-checkout-order-actions,
.modal.pos-checkout-modal .pos-checkout-payment-mode {
  padding: 12px 20px;
}

.modal.pos-checkout-modal .pos-checkout-order-actions button,
.modal.pos-checkout-modal .pos-checkout-payment-mode button,
.modal.pos-checkout-modal .pos-payment-choices button,
.modal.pos-checkout-modal .pos-quick-cash button {
  border-color: #4b4d53;
  background: #34363b;
  color: #f6f6f3;
}

.modal.pos-checkout-modal .pos-checkout-order-actions button.active,
.modal.pos-checkout-modal .pos-checkout-payment-mode button.active,
.modal.pos-checkout-modal .pos-payment-choices button.active {
  border-color: var(--gold);
  background: rgba(226, 169, 36, 0.13);
  color: var(--gold);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.modal.pos-checkout-modal .pos-checkout-section {
  padding: 18px 20px 0;
}

.modal.pos-checkout-modal .pos-payment-choices {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.modal.pos-checkout-modal .pos-payment-choices button {
  min-height: 78px;
  font-size: 14px;
}

.modal.pos-checkout-modal .pos-tender-input input,
.modal.pos-checkout-modal .pos-checkout-details select,
.modal.pos-checkout-modal .pos-checkout-details input,
.modal.pos-checkout-modal .pos-mixed-payment-row select,
.modal.pos-checkout-modal .pos-mixed-payment-row input {
  border-color: #4b4d53;
  background: #34363b;
  color: #fff;
}

.modal.pos-checkout-modal .pos-checkout-details {
  border-color: #44474d;
}

.modal.pos-checkout-modal .pos-checkout-details .grid {
  border-top-color: #44474d;
}

.modal.pos-checkout-modal .pos-checkout-hint,
.modal.pos-checkout-modal .pos-checkout-details summary {
  color: #bfc1c6;
}

.modal.pos-checkout-modal .pos-mixed-payment-row {
  border-color: #44474d;
  background: #2b2d31;
}

.modal.pos-checkout-modal .pos-checkout-actions {
  bottom: 0;
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid #44474d;
  background: #2b2d31;
}

.modal.pos-checkout-modal .pos-checkout-actions button {
  min-height: 62px;
  border-color: #4b4d53;
  background: #34363b;
  color: #fff;
}

.modal.pos-checkout-modal .pos-checkout-actions .primary {
  background: var(--gold);
  color: #18150d;
}

.modal.pos-split-modal .pos-split-mode button,
.modal.pos-split-modal .pos-split-custom-quick button,
.modal.pos-split-modal .pos-split-custom-grid > label,
.modal.pos-split-modal .pos-split-custom-grid > div,
.modal.pos-split-modal .pos-split-amount-row,
.modal.pos-split-modal .pos-split-amount-quick button {
  border-color: #44474d;
  background: #2b2d31;
  color: #f6f6f3;
}

.modal.pos-split-modal .pos-split-mode button.active,
.modal.pos-split-modal .pos-split-amount-row.active,
.modal.pos-split-modal .pos-split-amount-quick button.active {
  border-color: var(--gold);
  background: rgba(226, 169, 36, 0.13);
  color: var(--gold);
}

.pos-split-board {
  min-height: 460px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.pos-split-column {
  min-width: 300px;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  border: 1px solid #44474d;
  background: #2b2d31;
}

.pos-split-column > header,
.pos-split-column > footer {
  min-height: 72px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #44474d;
}

.pos-split-column > header span,
.pos-split-column > footer span {
  color: #aeb1b7;
}

.pos-split-column > header strong {
  color: var(--gold);
  font-size: 20px;
}

.pos-split-column > div {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.pos-split-column > footer {
  border-top: 1px solid #44474d;
  border-bottom: 0;
  font-size: 18px;
}

.modal.pos-split-modal .pos-split-line,
.pos-split-target-line {
  min-height: 76px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #44474d;
  background: transparent;
  color: #f6f6f3;
}

.pos-split-target-line {
  grid-template-columns: minmax(0, 1fr) auto;
}

.pos-split-target-line > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pos-split-target-line small,
.modal.pos-split-modal .pos-split-line small {
  color: #aeb1b7;
}

.pos-split-target-empty {
  min-height: 270px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #aeb1b7;
  text-align: center;
}

.pos-split-target-empty svg {
  width: 36px;
  height: 36px;
  color: var(--gold);
}

.modal.pos-split-modal .pos-split-total {
  border-color: #44474d;
  background: #2b2d31;
  color: #fff;
}

@media (max-width: 1100px) {
  #view-sales .pos-loyverse-shell .pos-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(350px, 0.8fr);
  }

  #view-sales .pos-loyverse-shell .pos-products {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  #view-sales .pos-loyverse-shell .pos-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 106px 52px;
  }
}

@media (max-width: 900px) {
  #view-sales .pos-loyverse-shell .pos-layout {
    grid-template-columns: 1fr;
  }

  #view-sales .pos-loyverse-shell .pos-layout > .pos-catalog-surface,
  #view-sales .pos-loyverse-shell .pos-cart {
    height: calc(100dvh - 230px);
    min-height: 560px;
  }

  #view-sales .pos-loyverse-shell .pos-mobile-switch {
    border-color: #44474d;
    background: #2b2d31;
  }

  #view-sales .pos-loyverse-shell .pos-mobile-switch button {
    color: #f6f6f3;
  }

  #view-sales .pos-loyverse-shell .pos-mobile-switch button.active {
    background: var(--gold);
    color: #18150d;
  }

  .modal.pos-checkout-modal .modal-inner {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .pos-checkout-ticket-summary {
    max-height: 34dvh;
    border-right: 0;
    border-bottom: 1px solid #44474d;
  }

  .pos-checkout-ticket-head {
    min-height: 86px;
    padding: 12px 16px;
  }

  .pos-checkout-ticket-lines {
    display: none;
  }

  .pos-checkout-ticket-totals {
    padding: 8px 16px;
  }

  .pos-checkout-ticket-totals > div:not(.grand) {
    display: none;
  }

  .pos-checkout-ticket-totals .grand {
    min-height: 42px;
    margin: 0;
    border: 0;
  }

  .modal.pos-client-modal {
    inset: var(--pos-workspace-top, 0px) 0 0;
  }

  .pos-orders-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-orders-sort,
  .pos-orders-search {
    width: 100%;
  }

  .pos-orders-sort button {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-width: 640px) {
  .pos-loyverse-shell {
    margin-right: -16px;
    margin-left: -16px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  #view-sales .pos-loyverse-shell .pos-order-launchbar {
    min-height: 62px;
    padding: 6px;
  }

  #view-sales .pos-loyverse-shell .pos-primary-order-actions {
    grid-template-columns: 1fr 1fr;
  }

  #view-sales .pos-loyverse-shell .pos-primary-order-actions > button {
    min-width: 0;
    min-height: 50px;
    padding: 5px 8px;
  }

  #view-sales .pos-loyverse-shell .pos-order-launchbar .pos-modebar-actions {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-catalog-toolbar {
    min-height: 118px;
    padding: 8px;
  }

  #view-sales .pos-loyverse-shell .pos-catalog-toolbar > div:first-child {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-toolbar-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 106px 52px;
  }

  #view-sales .pos-loyverse-shell .pos-toolbar-actions .pos-search {
    grid-column: 1 / -1;
  }

  #view-sales .pos-loyverse-shell .pos-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 154px;
    padding: 7px;
    gap: 6px;
  }

  #view-sales .pos-loyverse-shell .pos-products.view-grid .pos-product {
    height: 154px;
    min-height: 154px;
  }

  #view-sales .pos-loyverse-shell .pos-catalog-surface .pos-category-filters {
    position: static;
    min-height: 68px;
    padding: 6px;
  }

  #view-sales .pos-loyverse-shell .pos-catalog-surface .pos-category-filters button {
    min-width: 110px;
    min-height: 54px;
  }

  #view-sales .pos-loyverse-shell .pos-cart {
    margin: 0;
  }

  #view-sales .pos-loyverse-shell .pos-cart .cart-line {
    grid-template-columns: minmax(0, 1fr) auto 40px;
    grid-template-areas:
      "item amount remove"
      "item quantity remove";
  }

  .pos-ticket-menu > div {
    position: fixed;
    top: 132px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .modal.pos-client-modal .modal-head {
    min-height: 70px;
    padding: 10px 12px;
  }

  .pos-client-search,
  .pos-client-row {
    padding-right: 12px;
    padding-left: 12px;
  }

  .modal.pos-checkout-modal .pos-checkout-total {
    min-height: 94px;
    padding: 14px 16px;
  }

  .modal.pos-checkout-modal .pos-checkout-total strong {
    font-size: 32px;
  }

  .modal.pos-checkout-modal .pos-checkout-order-actions,
  .modal.pos-checkout-modal .pos-checkout-payment-mode {
    padding: 8px 10px;
  }

  .modal.pos-checkout-modal .pos-payment-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-split-board {
    min-height: 420px;
    padding: 10px;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }

  .modal.pos-split-modal #posSplitItemsPanel {
    overflow-x: auto;
  }
}

/* POS workspace overlays stay below the POS top bar. */
.pos-orders-modal,
.pos-checkout-modal,
.pos-split-modal {
  position: fixed;
  inset: var(--pos-workspace-top, 0px) 0 0;
  width: 100vw;
  max-width: none;
  height: calc(100dvh - var(--pos-workspace-top, 0px));
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.pos-orders-modal::backdrop,
.pos-checkout-modal::backdrop,
.pos-split-modal::backdrop {
  background: transparent;
}

.pos-orders-modal .modal-inner,
.pos-checkout-modal .modal-inner,
.pos-split-modal .modal-inner {
  width: 100%;
  min-height: 100%;
  max-height: 100%;
  border-radius: 0;
}

.pos-checkout-modal .modal-inner,
.pos-split-modal .modal-inner {
  padding: 18px clamp(16px, 3vw, 42px);
  overflow-y: auto;
}

.pos-checkout-modal .modal-head,
.pos-split-modal .modal-head {
  flex: 0 0 auto;
}

.pos-checkout-modal .pos-checkout-total {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.pos-checkout-modal .pos-checkout-actions,
.pos-split-modal .modal-actions {
  position: sticky;
  z-index: 3;
  bottom: -18px;
  margin-top: auto;
  padding: 14px 0 18px;
  background: var(--panel);
}

.pos-mixed-payment-row {
  grid-template-columns: 42px minmax(180px, 1fr) minmax(150px, 0.75fr) 52px;
  min-height: 76px;
  padding: 12px;
  gap: 12px;
}

.pos-mixed-payment-row select,
.pos-mixed-payment-row input {
  min-height: 52px;
  font-size: 17px;
}

.pos-split-amount-panel {
  padding: 18px 20px;
}

.pos-split-amount-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(420px, 1.3fr);
  align-items: end;
  gap: 18px;
}

.pos-split-amount-head > div:first-child {
  display: grid;
  gap: 5px;
}

.pos-split-amount-head > div:first-child strong {
  font-size: 18px;
}

.pos-split-amount-head > div:first-child span {
  color: var(--muted);
  font-size: 13px;
}

.pos-split-amount-quick {
  margin: 0;
  grid-template-columns: repeat(5, minmax(88px, 1fr));
}

.pos-split-amount-quick button {
  min-height: 58px;
  font-size: 14px;
  font-weight: 850;
}

.pos-split-amount-quick button.active {
  border: 2px solid var(--gold-dark);
  background: var(--gold-soft);
}

.pos-split-amount-rows {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.pos-split-amount-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.pos-split-amount-row.active {
  border: 2px solid var(--gold-dark);
  background: var(--gold-soft);
}

.pos-split-amount-copy {
  display: grid;
  gap: 4px;
}

.pos-split-amount-copy strong {
  font-size: 17px;
}

.pos-split-amount-copy small {
  color: var(--muted);
  font-size: 12px;
}

.pos-split-amount-value {
  font-size: 20px;
  white-space: nowrap;
}

/* Virtual keyboard behaves like a full-width touch keyboard. */
.pos-keyboard-modal {
  position: fixed;
  inset: auto 0 0;
  width: 100vw;
  max-width: none;
  max-height: min(68dvh, 610px);
  margin: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -16px 44px rgba(0, 0, 0, 0.18);
}

.pos-keyboard-modal::backdrop {
  background: rgba(0, 0, 0, 0.12);
}

.pos-keyboard-modal .modal-inner {
  width: 100%;
  max-height: min(68dvh, 610px);
  padding: 10px clamp(10px, 2vw, 28px) calc(12px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 8px 8px 0 0;
}

.pos-keyboard-modal .modal-head {
  min-height: 42px;
  padding-bottom: 6px;
}

.pos-keyboard-display {
  min-height: 54px;
  margin-bottom: 8px;
  padding: 8px 14px;
  font-size: 24px;
}

.pos-keyboard-keys {
  gap: 6px;
}

.pos-keyboard-keys > div {
  width: 100%;
  gap: 6px;
}

.pos-keyboard-keys button {
  width: auto;
  min-width: 0;
  min-height: 54px;
  padding: 4px;
  flex: 1 1 0;
  font-size: 17px;
}

.pos-keyboard-keys .space {
  width: auto;
  flex: 4 1 0;
}

@keyframes pos-spin {
  to { transform: rotate(360deg); }
}

[data-save-restaurant-order] .lucide-loader-circle {
  animation: pos-spin 0.8s linear infinite;
}

@media (max-width: 720px) {
  .pos-checkout-modal .modal-inner,
  .pos-split-modal .modal-inner {
    padding: 12px;
  }

  .pos-checkout-modal .pos-checkout-actions,
  .pos-split-modal .modal-actions {
    bottom: -12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .pos-mixed-payment-row {
    grid-template-columns: 38px minmax(0, 1fr) 48px;
  }

  .pos-mixed-payment-row label {
    grid-column: 2;
  }

  .pos-mixed-payment-row .pos-mixed-payment-index {
    grid-row: 1 / span 2;
  }

  .pos-mixed-payment-row .icon-button {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .pos-split-amount-head {
    grid-template-columns: 1fr;
  }

  .pos-split-amount-quick {
    display: flex;
    overflow-x: auto;
  }

  .pos-split-amount-quick button {
    min-width: 104px;
  }

  .pos-split-amount-rows {
    grid-template-columns: 1fr;
  }

  .pos-split-amount-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .pos-split-amount-row .pos-mixed-payment-index {
    grid-row: 1;
  }

  .pos-keyboard-modal {
    max-height: 62dvh;
  }

  .pos-keyboard-modal .modal-inner {
    max-height: 62dvh;
    padding: 7px 7px calc(9px + env(safe-area-inset-bottom));
  }

  .pos-keyboard-modal .modal-head {
    min-height: 36px;
  }

  .pos-keyboard-display {
    min-height: 46px;
    font-size: 19px;
  }

  .pos-keyboard-keys {
    gap: 3px;
  }

  .pos-keyboard-keys > div {
    gap: 3px;
  }

  .pos-keyboard-keys button {
    min-height: 43px;
    font-size: 13px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

button.primary {
  white-space: nowrap;
}

button:hover {
  border-color: #aab7c6;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.button-like:focus-visible {
  outline: 3px solid rgba(226, 169, 36, 0.38);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.danger-button {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.danger-button:hover {
  background: #8f1c14;
  border-color: #8f1c14;
}

button,
.link-button,
.date-range,
.stat-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

svg.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
  flex: 0 0 auto;
}

.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #17140c;
  box-shadow: 0 12px 22px rgba(226, 169, 36, 0.24);
}

.primary:hover {
  background: #c99213;
  border-color: #c99213;
}

.primary svg {
  color: #17140c;
}

.danger {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.ghost {
  background: transparent;
}

.icon-button {
  width: 38px;
  padding: 0;
  line-height: 1;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.app-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: 290px 1fr;
  overflow: hidden;
}

.sidebar {
  background: #111318;
  color: #f7fafc;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  height: 100vh;
  align-self: start;
  overflow-y: auto;
}

.brand {
  display: block;
  width: 100%;
  min-height: 68px;
}

.brand-logo-window {
  width: min(100%, 230px);
  aspect-ratio: 792.32 / 230.47;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tenant-switcher span {
  display: block;
  color: #aeb1b6;
  font-size: 13px;
  margin-top: 2px;
}

.tenant-switcher select {
  width: 100%;
  margin-top: 10px;
  background: rgba(24, 26, 30, 0.92);
  color: #fff;
  border: 1px solid rgba(185, 185, 185, 0.28);
  border-radius: 7px;
  height: 48px;
  padding: 0 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.experience-switcher {
  display: grid;
  gap: 7px;
}

.experience-switcher > span {
  color: #aeb1b6;
  font-size: 12px;
}

.experience-segmented {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid rgba(185, 185, 185, 0.25);
  border-radius: 8px;
  background: rgba(24, 26, 30, 0.9);
}

.experience-segmented button {
  min-width: 0;
  min-height: 32px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: #aeb1b6;
  font-size: 10px;
  font-weight: 800;
}

.experience-segmented button.active {
  background: var(--gold);
  color: #17140c;
}

.pos-quick-launch {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-color: rgba(226, 169, 36, 0.42);
  background: rgba(226, 169, 36, 0.08);
  color: #fff;
  text-align: left;
}

.pos-quick-launch:hover {
  border-color: var(--gold);
  background: rgba(226, 169, 36, 0.14);
}

.pos-quick-launch > svg:first-child {
  color: var(--gold);
}

.pos-quick-launch span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pos-quick-launch strong,
.pos-quick-launch small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-quick-launch small {
  color: #aeb1b6;
  font-size: 10px;
}

.nav {
  display: grid;
  gap: 20px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group-title {
  padding: 0 12px 5px;
  color: #777c85;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-item {
  color: #f0f0ed;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 7px;
  min-height: 42px;
  padding: 9px 12px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  width: 100%;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  box-shadow: none;
}

.nav-item.active,
.nav-item.active:hover {
  background: var(--gold);
  color: #17140c;
  box-shadow: none;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.tour-restart {
  justify-content: flex-start;
  min-height: 38px;
  border-color: rgba(185, 185, 185, 0.24);
  background: transparent;
  color: #d5d6d8;
  font-size: 12px;
}

.tour-restart svg {
  color: var(--gold);
}

.user-card,
.theme-card {
  min-height: 62px;
  border: 1px solid rgba(185, 185, 185, 0.24);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(24, 26, 30, 0.82);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f5d6b6, #b56f44);
  color: #17191d;
  font-weight: 800;
}

.user-card strong,
.theme-card strong {
  display: block;
  font-size: 14px;
}

.user-card span {
  color: #aeb1b6;
  font-size: 12px;
}

.mini-chevron {
  margin-left: auto;
  width: 28px;
  min-height: 28px;
  padding: 0;
  background: transparent;
  color: #fff;
  border: 0;
}

.mini-chevron svg {
  width: 18px;
  height: 18px;
}

.switch {
  margin-left: auto;
  width: 48px;
  min-height: 28px;
  border-radius: 999px;
  background: #3a3d42;
  border: 0;
  padding: 3px;
  justify-content: flex-start;
}

.switch span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.switch.active {
  background: var(--gold);
}

.switch.active span {
  transform: translateX(20px);
}

.main {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 36px 32px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-actions[hidden] {
  display: none;
}

.date-range {
  min-height: 50px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  color: #17191d;
  box-shadow: 0 8px 18px rgba(24, 24, 24, 0.05);
}

.date-range svg {
  width: 20px;
  height: 20px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
  min-height: 192px;
  position: relative;
  overflow: hidden;
}

.stat span {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 16px;
  font-size: 30px;
  letter-spacing: 0;
}

#view-dashboard .dashboard-stat > strong {
  font-size: 24px;
  white-space: nowrap;
}

.stat strong small {
  color: #484c53;
  font-size: 16px;
  font-weight: 700;
}

.stat-trend {
  margin-top: 22px;
  color: #00a344;
  font-weight: 700;
  justify-content: flex-start;
}

.stat-trend.neutral {
  color: #17191d;
}

.stat-trend.down {
  color: #b42318;
}

.stat-note {
  margin-top: 6px;
  max-width: calc(100% - 64px);
  line-height: 1.35;
  color: var(--muted);
}

.stat-icon {
  position: absolute;
  right: 18px;
  bottom: 26px;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  color: var(--gold-dark);
  background: var(--gold-soft);
}

.stat-icon svg {
  width: 34px;
  height: 34px;
}

.stat-icon.green {
  color: #09964b;
  background: #dff8ea;
}

.stat-icon.gold {
  color: var(--gold-dark);
  background: var(--gold-soft);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.pos-toolbar-actions,
.line-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel.pad {
  padding: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fbfcfe;
}

tr:last-child td {
  border-bottom: 0;
}

.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: #44484f;
  font-size: 12px;
  font-weight: 700;
}

.badge.paid,
.badge.approved,
.badge.active,
.badge.completed,
.badge.ok {
  background: #dcfce7;
  color: #166534;
}

.badge.sent,
.badge.partial,
.badge.partially_paid,
.badge.open {
  background: #eeeeea;
  color: #44484f;
}

.badge.draft,
.badge.pending,
.badge.to_complete,
.badge.to_review,
.badge.not_submitted {
  background: #fef3c7;
  color: #92400e;
}

.badge.overdue,
.badge.cancelled,
.badge.rejected,
.badge.alerte,
.badge.inactive {
  background: #fee2e2;
  color: #991b1b;
}

.badge.credited,
.badge.accepted {
  background: #f2ead1;
  color: #674a05;
}

.badge.posted,
.badge.accounted,
.badge.closed {
  background: #dcfce7;
  color: #166534;
}

.badge.reversed {
  background: #eeeae1;
  color: #5b5140;
}

.badge.current {
  margin-left: 6px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  vertical-align: middle;
}

.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.95fr);
  gap: 16px;
  margin-bottom: 16px;
}

.chart-card,
.donut-card {
  min-height: 342px;
  padding: 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.card-head h2 {
  margin: 0;
  font-size: 17px;
  text-transform: uppercase;
}

.mini-select {
  min-height: 40px;
  width: auto;
}

.sales-chart {
  height: 245px;
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: 1fr 28px;
}

.chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #50545b;
  font-size: 13px;
  padding: 2px 0 28px;
}

.chart-area {
  position: relative;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 50px, #e8edf4 51px),
    linear-gradient(to top, rgba(226, 169, 36, 0.15), rgba(226, 169, 36, 0.01));
  overflow: hidden;
}

.chart-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.chart-x {
  grid-column: 2;
  position: relative;
  color: #50545b;
  font-size: 13px;
  padding-top: 8px;
}

.chart-x span {
  position: absolute;
  top: 8px;
  white-space: nowrap;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 28px;
}

.donut {
  width: 190px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0 50%, #73777e 50% 100%, #d63c4f 100% 100%);
  display: grid;
  place-items: center;
}

.donut-center {
  width: 114px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 30px;
}

.donut-center span {
  color: var(--muted);
}

.legend {
  display: grid;
  gap: 22px;
}

.legend-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  align-items: center;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
}

.dot.pending {
  background: #73777e;
}

.dot.late {
  background: #f21b57;
}

.table-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.table-titlebar h2 {
  margin: 0;
  font-size: 17px;
  text-transform: uppercase;
}

.link-button {
  color: var(--brand-dark);
  background: transparent;
  border: 0;
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.square-action {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.square-action svg {
  width: 18px;
  height: 18px;
}

.danger-icon {
  color: #b42318;
}

.positive {
  color: #138a43;
  font-weight: 700;
}

.negative {
  color: #b42318;
  font-weight: 700;
}

.section-gap {
  margin-top: 24px;
}

.compact-search {
  width: min(320px, 100%);
}

.toolbar-actions .compact-search {
  position: relative;
  display: block;
}

.toolbar-actions .compact-search svg {
  position: absolute;
  z-index: 1;
  left: 10px;
  top: 10px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.toolbar-actions .compact-search input {
  min-height: 38px;
  padding-left: 36px;
}

.compact-stats .stat {
  min-height: 148px;
}

.compact-stats .stat strong {
  margin-top: 12px;
}

.compact-stats .stat-icon {
  bottom: 18px;
  width: 54px;
  height: 54px;
}

.compact-stats .stat-icon svg {
  width: 27px;
  height: 27px;
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.pos-layout > * {
  min-width: 0;
}

.pos-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.pos-mobile-switch {
  display: none;
}

.pos-products.view-list {
  grid-template-columns: 1fr;
}

.pos-category-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 3px;
}

.pos-category-filters button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.pos-category-filters button.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold-dark);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.pos-category-filters button span,
.category-label > span,
.category-color {
  width: 9px;
  height: 9px;
  display: inline-block;
  flex: 0 0 auto;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--category-color);
}

.icon-segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, 38px);
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.icon-segmented button {
  min-width: 38px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.icon-segmented button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--gold);
}

.pos-product {
  width: 100%;
  min-width: 0;
  min-height: 218px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(24, 24, 24, 0.06);
  overflow: hidden;
}

.pos-product:hover:not(:disabled) {
  border-color: var(--gold);
  box-shadow: 0 10px 24px rgba(226, 169, 36, 0.15);
}

.pos-product-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--gold-dark);
  background: var(--gold-soft);
  border-radius: 7px 7px 0 0;
}

.pos-product-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pos-product-media svg {
  width: 34px;
  height: 34px;
}

.pos-product-copy {
  width: 100%;
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.pos-product-copy strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.pos-product-copy > span {
  color: var(--brand);
  font-weight: 800;
}

.pos-product-copy small {
  color: var(--muted);
}

.pos-product-copy .pos-category {
  color: #667085;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.pos-products.view-list .pos-product {
  min-height: 82px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
}

.pos-products.view-list .pos-product-media {
  height: 100%;
  aspect-ratio: auto;
  border-radius: 7px 0 0 7px;
}

.pos-products.view-list .pos-product-copy {
  align-content: center;
  grid-template-columns: minmax(0, 1fr) auto;
}

.pos-products.view-list .pos-product-copy > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.pos-products.view-list .pos-product-copy > span {
  align-self: start;
  white-space: nowrap;
}

.pos-products.view-list .pos-product-copy .pos-category,
.pos-products.view-list .pos-product-copy small:last-child {
  grid-column: 1 / -1;
}

.pos-cart {
  position: sticky;
  top: 18px;
}

.cart-lines {
  max-height: 330px;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 38px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line > div:first-child {
  min-width: 0;
}

.cart-line > div:first-child strong,
.cart-line > div:first-child span {
  display: block;
}

.cart-line > div:first-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 30px 28px 30px;
  align-items: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.quantity-stepper button {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.quantity-stepper svg {
  width: 14px;
  height: 14px;
}

.pos-fields {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pos-fields [data-pos-credit-hint] {
  grid-column: 1 / -1;
}

.pos-fields > label,
.pos-fields > .client-field {
  align-content: start;
}

.pos-summary {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.pos-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pos-summary .grand {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.pos-pay {
  width: calc(100% - 32px);
  min-height: 50px;
  margin: 0 16px 16px;
}

.settings-section + .settings-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.settings-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.settings-tabs button {
  flex: 0 0 auto;
  min-height: 42px;
  background: var(--panel);
}

.settings-tabs button.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold-dark);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.settings-section[data-settings-panel] {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.settings-section[data-settings-panel="billing"] + .settings-section[data-settings-panel="billing"] {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.settings-heading {
  margin-bottom: 16px;
}

.menu-visibility-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.menu-visibility-option {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  cursor: pointer;
}

.menu-visibility-option input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--gold);
}

.menu-visibility-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.menu-visibility-option > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.menu-visibility-option small {
  color: var(--muted);
}

.settings-heading h2,
.settings-heading p,
.toolbar p {
  margin: 0;
}

.settings-heading h2 {
  font-size: 18px;
}

.settings-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.document-settings-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.logo-setting,
.document-options,
.document-style-setting {
  display: grid;
  gap: 10px;
}

.field-label,
.document-style-setting > span {
  color: #344054;
  font-size: 13px;
}

.company-logo-preview {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 190px;
  overflow: hidden;
  border: 1px dashed #aab7c6;
  border-radius: 7px;
  background: var(--panel-2);
}

.company-logo-crop-frame {
  width: min(var(--logo-preview-width, 180px), 100%);
  height: min(var(--logo-preview-height, 74px), 160px);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
}

.company-logo-crop-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--logo-preview-fit, contain);
  object-position: var(--logo-preview-x, 50%) var(--logo-preview-y, 50%);
  transform: scale(var(--logo-preview-scale, 1));
  transform-origin: var(--logo-preview-x, 50%) var(--logo-preview-y, 50%);
}

.company-logo-preview span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.company-logo-preview [hidden] {
  display: none;
}

.logo-setting-actions,
.color-setting {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-setting-actions > * {
  flex: 1;
}

.logo-crop-controls {
  align-items: end;
}

.logo-crop-controls input[type="range"] {
  min-height: 38px;
  padding: 0;
}

.range-with-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
}

.range-with-value output {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.catalog-image-editor {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}

.product-barcode-capture {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d8bf73;
  border-radius: 7px;
  background: #fffaf0;
}

.product-barcode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.product-barcode-capture small {
  color: var(--muted);
  line-height: 1.4;
}

input[readonly] {
  background: var(--panel-2);
  color: var(--muted);
}

.catalog-image-editor > .field-label {
  grid-column: 1 / -1;
}

.catalog-image-preview {
  width: 140px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #aab7c6;
  border-radius: 7px;
  background: var(--panel-2);
}

.catalog-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.catalog-image-preview span {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.catalog-image-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dgii-lookup {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #dec67e;
  border-radius: 7px;
  background: #fffaf0;
}

.dgii-lookup > div:first-child,
.expense-capture-copy {
  display: grid;
  gap: 3px;
}

.dgii-lookup small,
.expense-capture small,
.segmented-field small,
.expense-primary-grid label > small {
  color: var(--muted);
  line-height: 1.4;
}

.lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.dgii-results {
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.dgii-result {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}

.dgii-result:last-child {
  border-bottom: 0;
}

.dgii-result > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dgii-result > span:last-child {
  text-align: right;
}

.dgii-result strong,
.dgii-result small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lookup-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
}

.error-text,
.danger-text {
  color: #b42318;
}

.expense-capture {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

body[data-experience-mode="simple"] [data-experience-min="ADVANCED"],
body[data-experience-mode="simple"] [data-experience-min="COMPLETE"],
body[data-experience-mode="advanced"] [data-experience-min="COMPLETE"] {
  display: none !important;
}

.quick-expense-modal {
  width: min(620px, calc(100vw - 24px));
}

.quick-expense-capture {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.quick-expense-actions {
  display: grid;
  gap: 8px;
}

.quick-expense-actions > * {
  width: 100%;
  justify-content: center;
}

.workflow-callout {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-block: 14px;
  padding: 11px 12px;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
}

.workflow-callout > svg {
  flex: 0 0 auto;
  color: var(--gold-dark);
}

.workflow-callout > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.workflow-callout small {
  color: var(--muted);
  line-height: 1.35;
}

.section-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.section-tabs button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.section-tabs button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(15 23 42 / 10%);
}

.section-tabs button > span {
  min-width: 23px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 11px;
  text-align: center;
}

.purchase-balance-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.purchase-balance-summary > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.purchase-balance-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.supplier-payment-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.supplier-payment-summary > span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--panel-2);
}

.supplier-payment-summary small {
  color: var(--muted);
}

.supplier-payment-summary strong {
  overflow-wrap: anywhere;
}

.compact-button {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.overdue-copy {
  color: #b42318;
  font-weight: 700;
}

.section-heading {
  margin: 26px 0 10px;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading p {
  margin-top: 3px;
  color: var(--muted);
}

.purchase-mobile-list {
  display: none;
}

.purchase-mobile-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.purchase-mobile-card header,
.purchase-mobile-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.purchase-mobile-card header > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.purchase-mobile-card header small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-mobile-card > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.purchase-mobile-card > div > span {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.purchase-mobile-card > div b {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
}

.stat-icon.red {
  background: #fee2e2;
  color: #b42318;
}

.expense-receipt-preview {
  width: 180px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #a8a9a7;
  border-radius: 7px;
  background: var(--panel);
}

.expense-receipt-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.expense-receipt-preview span {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.expense-capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.expense-document-status {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-left: 3px solid #98a2b3;
  background: var(--panel-2);
}

.expense-document-status > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.expense-document-status small {
  color: var(--muted);
  line-height: 1.35;
}

.expense-document-status.fiscal {
  border-left-color: var(--brand);
  background: #fffaf0;
  color: #674a05;
}

.expense-document-status.pending {
  border-left-color: #e2a924;
  background: #fff8e8;
  color: #674a05;
}

.expense-document-status.invalid {
  border-left-color: #b42318;
  background: #fff1f0;
  color: #8f1d14;
}

.expense-tax-panel {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.expense-tax-panel[hidden] {
  display: none;
}

.expense-tax-panel .section-heading {
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.expense-tax-panel .section-heading h3,
.expense-tax-panel .section-heading p {
  margin: 0;
}

.expense-tax-panel .section-heading p,
.expense-tax-profile small,
.expense-tax-grid label > small {
  color: var(--muted);
  line-height: 1.4;
}

.expense-tax-state {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff0c7;
  color: #775500;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.expense-tax-state.confirmed {
  background: #e6f6ed;
  color: #08783d;
}

.expense-tax-state.invalid {
  background: #fee4e2;
  color: #b42318;
}

.expense-tax-profile {
  display: grid;
  gap: 5px;
}

.expense-tax-grid label {
  min-width: 0;
}

.expense-tax-check {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.expense-tax-check > span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  background: var(--panel-2);
}

.expense-tax-check small {
  color: var(--muted);
}

.expense-tax-check strong {
  overflow-wrap: anywhere;
}

.expense-tax-check .difference {
  color: #b42318;
}

.expense-tax-confirm {
  justify-self: start;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.expense-extra-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.expense-extra-details > summary {
  padding: 12px 2px;
  cursor: pointer;
}

.expense-extra-details > summary::marker {
  color: var(--brand);
}

.expense-extra-details > summary > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 8px;
  font-weight: 700;
}

.expense-extra-details > summary > small {
  color: var(--muted);
}

.expense-details-grid {
  padding: 4px 0 14px;
}

.expense-extra-details:not([open]) > .expense-details-grid {
  display: none;
}

.expense-fiscal-meta {
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid #dec67e;
  border-radius: 7px;
  background: #fffaf0;
  color: #674a05;
  font-size: 13px;
}

.expense-fiscal-meta > span,
.expense-fiscal-meta > a {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.expense-fiscal-meta > span b {
  overflow-wrap: anywhere;
}

.expense-fiscal-meta > a {
  flex: none;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.expense-fiscal-meta > small {
  width: 100%;
  color: var(--muted);
  line-height: 1.4;
}

.expense-fiscal-meta > small.warning {
  color: #b54708;
  font-weight: 700;
}

.segmented-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented-field legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 5px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.segmented-choice label {
  display: block;
}

.segmented-choice input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.segmented-choice span {
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 7px 10px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.segmented-choice label:last-child span {
  border-right: 0;
}

.segmented-choice input:checked + span {
  background: var(--brand);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--gold);
}

.expense-breakdown {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.expense-breakdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.expense-breakdown-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.expense-breakdown-head small {
  max-width: 740px;
  color: var(--muted);
  line-height: 1.45;
}

.expense-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-left: 3px solid #f4b223;
  background: #fff8e8;
  color: #5c4614;
  line-height: 1.4;
}

.expense-confirmation input {
  width: 17px;
  min-height: 17px;
  margin-top: 1px;
}

.expense-tax-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.expense-tax-summary > div {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--panel);
}

.expense-tax-summary span {
  color: var(--muted);
  font-size: 12px;
}

.expense-tax-summary strong {
  font-size: 16px;
}

.expense-tax-summary .expense-tax-credit {
  background: #effaf4;
}

.expense-tax-credit strong {
  color: #08783d;
}

.receipt-viewer-modal {
  width: min(900px, calc(100vw - 28px));
}

.receipt-viewer-modal img {
  width: 100%;
  max-height: calc(100vh - 110px);
  display: block;
  object-fit: contain;
  background: var(--panel-2);
}

.catalog-name-cell {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-thumb {
  width: 48px;
  height: 48px;
  display: block;
  flex: 0 0 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f1f1ed;
}

.catalog-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--brand);
}

.catalog-thumb-placeholder svg {
  width: 22px;
  height: 22px;
}

.category-label {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.button-like:hover {
  border-color: #aab7c6;
}

.document-options {
  gap: 14px;
}

.segmented.document-style-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.document-style-options label {
  display: block;
}

.document-style-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.document-style-options span {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.document-style-options label:last-child span {
  border-right: 0;
}

.document-style-options input:checked + span {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--gold);
}

.document-style-options input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.color-setting input[type="color"] {
  width: 52px;
  min-height: 42px;
  padding: 4px;
}

.color-setting output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.document-footer-settings {
  margin-top: 16px;
}

.payment-method-settings {
  display: grid;
  gap: 8px;
}

.payment-method-setting {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto 40px;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.payment-method-setting .checkline {
  min-height: 40px;
}

.payment-method-setting .icon-button {
  margin-bottom: 1px;
}

#userModal,
#roleModal {
  width: min(1040px, calc(100vw - 28px));
}

.access-modal {
  display: grid;
  gap: 14px;
}

.form-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.permission-axis {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.permission-axis > header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.permission-axis > header > span {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.permission-axis > header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.permission-axis > header strong {
  font-size: 14px;
}

.permission-axis > header small {
  color: var(--muted);
  font-size: 12px;
}

.permission-modules {
  display: grid;
}

.permission-module {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(190px, .7fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}

.permission-module:first-child {
  border-top: 0;
}

.permission-module-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.permission-module-name svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--muted);
}

.permission-module-name strong {
  font-size: 13px;
}

.permission-actions {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.permission-check {
  position: relative;
}

.permission-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.permission-check span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.permission-check input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.permission-check input:checked + span {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.permission-overrides {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.permission-overrides > summary {
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.permission-overrides > summary::-webkit-details-marker {
  display: none;
}

.permission-overrides > summary span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.permission-overrides > summary small {
  color: var(--muted);
}

.permission-overrides > .form-help {
  padding: 0 14px 2px;
}

.permission-overrides #userPermissionsMatrix {
  padding: 0 12px 12px;
}

.permission-override-control {
  min-width: 190px;
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(150px, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.permission-override-control > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.permission-override-control select {
  min-height: 34px;
  padding: 5px 28px 5px 8px;
  font-size: 12px;
}

.permission-override-control > em {
  min-width: 88px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.permission-override-control > em svg {
  width: 13px;
  height: 13px;
}

.permission-override-control.effective-allow {
  border-color: rgba(19, 138, 67, 0.18);
  background: rgba(19, 138, 67, 0.04);
}

.permission-override-control.effective-allow > em {
  color: var(--ok);
}

.permission-override-control.effective-deny > em {
  color: #8a8d93;
}

.role-access-summary span {
  display: grid;
  gap: 3px;
}

.role-access-summary small {
  color: var(--muted);
  font-size: 11px;
}

.role-access-summary,
.read-only-notice {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(226, 169, 36, .42);
  border-radius: 7px;
  background: var(--gold-soft);
  color: var(--ink);
}

.role-access-summary svg,
.read-only-notice svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--gold-dark);
}

.role-axis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0;
}

.role-axis-tags span,
.access-adjustment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 700;
}

.role-axis-tags span {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--gold-soft);
}

.access-adjustment svg {
  width: 12px;
  height: 12px;
}

.role-explainer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.role-explainer > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.role-explainer-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.role-explainer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.role-explainer strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.invite-link-panel {
  display: grid;
  gap: 15px;
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.invite-success {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(35, 135, 111, .3);
  border-radius: 7px;
  background: rgba(35, 135, 111, .08);
}

.invite-success > span,
.activation-state {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(35, 135, 111, .13);
  color: #23876f;
}

.invite-success > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.invite-success small {
  color: var(--muted);
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 7px;
}

.copy-field button {
  min-height: 42px;
  padding: 0;
}

.integrations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.integration-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.integration-head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
}

.integration-head > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.integration-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  color: var(--brand);
  background: var(--gold-soft);
  border-radius: 7px;
}

.integration-fields {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.integration-env {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.integration-env code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
}

.integration-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.integration-actions .checkline {
  padding-top: 0;
}

.subscription-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.subscription-summary h2 {
  margin: 5px 0;
  font-size: 28px;
}

.subscription-summary p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.subscription-usage {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
}

.subscription-usage span {
  display: grid;
  gap: 5px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
}

.subscription-usage strong {
  color: var(--ink);
  font-size: 18px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 350px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.plan-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), var(--shadow);
}

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-card-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-card-head > div > strong {
  font-size: 18px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 18px;
  font-size: 26px;
  font-weight: 800;
}

.plan-price span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.plan-limits {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.plan-limits span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.plan-limits svg,
.plan-card li svg {
  width: 16px;
  height: 16px;
}

.plan-card ul {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.plan-card li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.plan-card > button {
  width: 100%;
  margin-top: auto;
}

.export-row {
  padding: 14px 24px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

.client-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #344054;
  font-size: 13px;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.field-hint.warning {
  color: #b54708;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: stretch;
}

.input-with-action > input {
  min-width: 0;
}

.input-with-action > select {
  min-width: 0;
}

.input-with-action > .icon-button {
  min-height: 42px;
}

.client-field .input-with-action > .icon-button {
  min-height: 38px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 25px;
}

.checkline input {
  width: auto;
  min-height: auto;
}

.modal {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.modal.large {
  width: min(980px, calc(100vw - 28px));
}

.modal.xlarge {
  width: min(1100px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.42);
}

.modal-inner {
  padding: 18px;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.scanner-modal {
  width: min(560px, calc(100vw - 28px));
}

.scanner-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid #3a3d42;
  border-radius: 8px;
  background: #111315;
}

.scanner-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-guide {
  position: absolute;
  inset: 24% 12%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.26);
  pointer-events: none;
}

.scanner-modal[data-scan-mode="qr"] .scanner-preview {
  aspect-ratio: 4 / 3;
}

.scanner-modal[data-scan-mode="qr"] .scanner-guide {
  width: min(58%, 240px);
  aspect-ratio: 1;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.scanner-camera-state {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 24px);
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 7px;
  color: #f0f0ed;
  background: rgba(0, 0, 0, 0.82);
  font-size: 13px;
}

.scanner-camera-state.live {
  color: #d9ffe7;
  background: rgba(10, 95, 48, 0.88);
}

.scanner-camera-state.error {
  color: #fff;
  background: rgba(180, 35, 24, 0.9);
}

.scanner-code-form {
  margin-top: 14px;
}

.scanner-result {
  min-height: 22px;
  margin-top: 10px;
  color: var(--ok);
  font-size: 13px;
  font-weight: 700;
}

.scanner-result.error {
  color: var(--accent);
}

.scanner-actions {
  align-items: center;
  justify-content: space-between;
}

.line-editor {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.line-head,
.form-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.invoice-line {
  display: grid;
  grid-template-columns: 1.3fr 2fr 76px 110px 100px 92px 38px;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

.invoice-line .checkline {
  padding-top: 0;
  justify-content: center;
}

.line-tax {
  align-self: stretch;
}

.line-tax-value {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid #b7dfc6;
  border-radius: 7px;
  background: #ecfdf3;
  color: #166534;
  font-weight: 800;
}

.line-tax-value.exempt {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--muted);
}

.form-total {
  justify-content: flex-end;
  margin-top: 14px;
  color: var(--muted);
}

.form-total span {
  min-width: 120px;
  text-align: right;
}

.document-preview {
  --doc-accent: #e2a924;
  background: #fff;
  color: #111827;
  border: 1px solid var(--line);
  padding: 34px;
  margin: 0 auto;
}

.document-preview.paper-a4 {
  max-width: 794px;
}

.document-preview.paper-letter {
  max-width: 816px;
}

.document-preview.layout-compact {
  padding: 24px;
}

.document-preview.layout-spacious {
  padding: 46px;
}

.document-preview table {
  min-width: 0;
  table-layout: fixed;
  font-size: 11px;
}

.document-preview table th,
.document-preview table td {
  padding: 10px 8px;
}

.document-preview table .amount {
  white-space: nowrap;
}

.document-preview th:first-child,
.document-preview td:first-child {
  width: 34%;
  overflow-wrap: anywhere;
}

.document-preview .doc-items-table.without-discount th:first-child,
.document-preview .doc-items-table.without-discount td:first-child {
  width: 40%;
}

.document-preview th:nth-child(2),
.document-preview td:nth-child(2) {
  width: 8%;
}

.document-preview .doc-items-table.without-discount th:nth-child(n + 3),
.document-preview .doc-items-table.without-discount td:nth-child(n + 3) {
  width: 17.333%;
}

.document-preview th:nth-child(3),
.document-preview td:nth-child(3),
.document-preview th:nth-child(4),
.document-preview td:nth-child(4),
.document-preview th:nth-child(5),
.document-preview td:nth-child(5),
.document-preview th:nth-child(6),
.document-preview td:nth-child(6) {
  width: 14.5%;
}

.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-bottom: 3px solid var(--doc-accent);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.doc-head h3 {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  column-gap: 0;
  row-gap: 2px;
  margin: 0;
  font-size: 28px;
  color: var(--doc-accent);
}

.doc-title-number {
  display: inline-block;
  padding-left: 12px;
}

.doc-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.doc-logo-frame {
  width: var(--doc-logo-width, 180px);
  max-width: 240px;
  height: var(--doc-logo-height, 74px);
  max-height: 140px;
  flex: 0 0 auto;
  overflow: hidden;
}

.doc-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--doc-logo-fit, contain);
  object-position: var(--doc-logo-x, 50%) var(--doc-logo-y, 50%);
  transform: scale(var(--doc-logo-scale, 1));
  transform-origin: var(--doc-logo-x, 50%) var(--doc-logo-y, 50%);
}

.doc-company {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #475467;
  font-size: 12px;
}

.doc-company strong {
  color: #111827;
  font-size: 17px;
}

.doc-title {
  flex: 0 0 auto;
  text-align: right;
}

.doc-title p {
  margin: 6px 0 0;
  color: #667085;
  font-size: 12px;
}

.document-preview.logo-center .doc-head {
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.document-preview.logo-center .doc-brand {
  align-items: center;
  flex-direction: column;
  width: 100%;
}

.document-preview.logo-center .doc-title {
  width: 100%;
  text-align: center;
}

.document-preview.logo-center .doc-title h3 {
  justify-content: center;
}

.document-preview.logo-right .doc-head {
  flex-direction: row-reverse;
}

.document-preview.logo-right .doc-brand {
  flex-direction: row-reverse;
  text-align: right;
}

.document-preview.logo-right .doc-title {
  text-align: left;
}

.document-preview.logo-right .doc-title h3 {
  justify-content: flex-start;
}

.doc-meta,
.doc-parties {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.doc-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.doc-box strong {
  display: block;
  margin-bottom: 6px;
}

.doc-total {
  margin-left: auto;
  width: min(360px, 100%);
}

.doc-total div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.doc-total .grand {
  font-size: 20px;
  font-weight: 800;
  color: var(--doc-accent);
}

.doc-payment-terms {
  margin-top: 28px;
  padding: 12px 14px;
  border-left: 3px solid var(--doc-accent);
  background: #f8fafc;
  color: #475467;
  font-size: 11px;
  line-height: 1.55;
  break-inside: avoid;
}

.doc-payment-terms > strong {
  display: block;
  margin-bottom: 5px;
  color: #111827;
  font-size: 12px;
}

.doc-payment-terms p {
  margin: 3px 0;
}

.doc-payment-terms span {
  color: #111827;
  font-weight: 700;
}

.doc-footer {
  margin-top: 42px;
  padding-top: 14px;
  border-top: 1px solid var(--doc-accent);
  color: #667085;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.document-preview.style-modern {
  border-top: 8px solid var(--doc-accent);
}

.document-preview.style-modern .doc-head {
  border-bottom: 0;
}

.document-preview.style-modern thead th {
  background: var(--doc-accent);
  color: #fff;
}

.document-preview.style-modern .doc-box {
  border-left: 4px solid var(--doc-accent);
}

.document-preview.style-minimal {
  border-color: transparent;
}

.document-preview.style-minimal .doc-head {
  border-bottom-width: 1px;
}

.document-preview.style-minimal .doc-box {
  padding: 0;
  border: 0;
  border-radius: 0;
}

.document-preview.style-minimal thead th {
  background: #fff;
  color: #475467;
  border-bottom: 2px solid var(--doc-accent);
}

.document-preview.layout-compact th,
.document-preview.layout-compact td {
  padding: 8px 10px;
}

.document-preview.layout-compact .doc-meta {
  gap: 10px;
  margin-bottom: 14px;
}

.document-preview.layout-spacious th,
.document-preview.layout-spacious td {
  padding: 15px 16px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #17191d;
}

.login-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.login-brand {
  min-height: 82px;
  display: flex;
  align-items: center;
  padding: 14px 24px;
  margin: -28px -28px 0;
  border-radius: 8px 8px 0 0;
  background: #17191d;
}

.login-logo-window {
  width: min(100%, 244px);
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel h1 {
  font-size: 26px;
}

.login-panel > div > p {
  margin-top: 5px;
  color: var(--muted);
}

.login-panel > button {
  min-height: 46px;
}

.activation-panel,
.invitation-error {
  gap: 16px;
}

.activation-state {
  width: 48px;
  height: 48px;
  margin-bottom: -2px;
}

.activation-state.error {
  background: rgba(190, 24, 42, .1);
  color: var(--accent);
}

.activation-identity {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.activation-identity span {
  font-weight: 700;
}

.activation-identity small,
.password-guidance {
  color: var(--muted);
  font-size: 12px;
}

.button-link {
  min-height: 44px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 9px 14px;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 700;
}

.login-error {
  min-height: 18px;
  color: var(--accent);
  font-size: 13px;
}

.login-page-signin {
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(380px, 0.88fr) minmax(520px, 1.12fr);
  place-items: stretch;
  padding: 0;
  overflow: auto;
  background: #fff;
}

.login-brand-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(34px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #17191d;
  color: #fff;
}

.login-brand-stage::before,
.login-brand-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-brand-stage::before {
  width: 42%;
  height: 46%;
  right: -1px;
  bottom: -1px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.login-brand-stage::after {
  width: 86px;
  height: 8px;
  left: clamp(34px, 5vw, 72px);
  bottom: clamp(112px, 13vh, 156px);
  background: var(--gold);
}

.login-brand-lockup,
.login-brand-message,
.login-brand-footer {
  position: relative;
  z-index: 1;
}

.login-brand-lockup .login-logo-window {
  width: min(292px, 72%);
}

.login-brand-message {
  max-width: 560px;
  margin: auto 0;
  padding: 64px 0;
}

.login-brand-message > span {
  display: block;
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-brand-message h2 {
  max-width: 520px;
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 4.6vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}

.login-brand-message p {
  max-width: 470px;
  margin: 24px 0 0;
  color: #b9bcc2;
  font-size: 17px;
  line-height: 1.65;
}

.login-brand-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aeb1b6;
  font-size: 13px;
}

.login-brand-footer svg {
  width: 19px;
  height: 19px;
  color: var(--gold);
}

.login-access {
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(36px, 6vw, 92px);
  display: grid;
  place-items: center;
  background: #fff;
}

.login-panel.login-panel-signin {
  width: min(440px, 100%);
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-heading {
  margin-bottom: 38px;
}

.login-title-mobile {
  display: none;
}

.login-panel-signin .login-kicker {
  display: block;
  margin-bottom: 13px;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.login-panel.login-panel-signin h1 {
  color: #17191d;
  font-size: clamp(34px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.login-panel.login-panel-signin .login-heading > p {
  margin-top: 12px;
  color: #62666d;
  font-size: 16px;
}

.login-fields {
  display: grid;
  gap: 22px;
}

.login-field {
  display: grid;
  gap: 9px;
}

.login-field > label {
  color: #303238;
  font-size: 13px;
  font-weight: 750;
}

.login-input {
  min-height: 56px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 0 16px;
  border: 1px solid #d8d7d2;
  border-radius: 7px;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-input:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(226, 169, 36, 0.15);
}

.login-input > svg {
  width: 20px;
  height: 20px;
  color: #858890;
}

.login-input input {
  min-width: 0;
  min-height: 54px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  font-size: 15px;
}

.login-input input::placeholder {
  color: #9a9ca2;
}

.login-input.login-password {
  grid-template-columns: 22px minmax(0, 1fr) 42px;
  padding-right: 6px;
}

.login-password-toggle {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #62666d;
}

.login-password-toggle:hover {
  border-color: transparent;
  background: #f4f3ef;
  color: #17191d;
}

.login-panel.login-panel-signin .login-error {
  min-height: 20px;
  margin: 13px 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

.login-panel.login-panel-signin .login-error:empty {
  visibility: hidden;
}

.login-panel.login-panel-signin .login-submit {
  width: 100%;
  min-height: 56px;
  justify-content: space-between;
  padding: 0 18px 0 22px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 850;
}

.login-panel.login-panel-signin .login-submit svg {
  width: 20px;
  height: 20px;
}

.login-footnote {
  margin: 24px 0 0 !important;
  color: #858890 !important;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 900px) {
  .login-page-signin {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .login-brand-stage {
    min-height: 220px;
    padding: 28px 32px;
  }

  .login-brand-stage::after {
    left: 32px;
    bottom: 28px;
  }

  .login-brand-lockup .login-logo-window {
    width: 232px;
  }

  .login-brand-message {
    margin: auto 0 0;
    padding: 22px 0 28px;
  }

  .login-brand-message > span,
  .login-brand-message p,
  .login-brand-footer {
    display: none;
  }

  .login-brand-message h2 {
    max-width: none;
    font-size: 31px;
    line-height: 1.08;
  }

  .login-access {
    min-height: auto;
    padding: 52px 32px 64px;
    place-items: start center;
  }
}

@media (max-width: 520px) {
  .login-page-signin {
    grid-template-rows: 138px minmax(0, 1fr);
    background: #17191d;
  }

  .login-brand-stage {
    min-height: 138px;
    height: 138px;
    padding: 22px 24px 0;
    align-items: center;
    justify-content: center;
  }

  .login-brand-stage::before,
  .login-brand-stage::after,
  .login-brand-message {
    display: none;
  }

  .login-brand-lockup {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .login-brand-lockup .login-logo-window {
    width: 202px;
  }

  .login-access {
    min-height: 0;
    padding: 10px 24px calc(30px + env(safe-area-inset-bottom));
    align-content: start;
    background: #17191d;
  }

  .login-heading {
    margin-bottom: 30px;
    text-align: center;
  }

  .login-panel.login-panel-signin h1 {
    color: #fff;
    font-size: 30px;
  }

  .login-panel.login-panel-signin .login-kicker {
    display: none;
  }

  .login-title-desktop {
    display: none;
  }

  .login-title-mobile {
    display: inline;
  }

  .login-panel.login-panel-signin .login-heading > p {
    margin-top: 9px;
    color: #aeb1b6;
    font-size: 14px;
  }

  .login-fields {
    gap: 20px;
  }

  .login-field > label {
    color: #e3e4e7;
    font-size: 13px;
  }

  .login-input {
    min-height: 58px;
    border-color: #383b42;
    background: #22252b;
  }

  .login-input input {
    min-height: 56px;
    color: #fff;
    font-size: 16px;
  }

  .login-input input::placeholder {
    color: #858890;
  }

  .login-input > svg {
    color: #9a9da4;
  }

  .login-password-toggle {
    color: #aeb1b6;
  }

  .login-password-toggle:hover {
    background: #2c3037;
    color: #fff;
  }

  .login-input input:-webkit-autofill,
  .login-input input:-webkit-autofill:hover,
  .login-input input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    box-shadow: 0 0 0 1000px #22252b inset;
  }

  .login-panel.login-panel-signin .login-error {
    margin-top: 10px;
    margin-bottom: 6px;
    color: #ff8f86;
  }

  .login-panel.login-panel-signin .login-submit {
    min-height: 58px;
    box-shadow: 0 12px 26px rgba(226, 169, 36, 0.18);
  }

  .login-footnote {
    display: none;
  }
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #111827;
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 160ms ease;
  z-index: 100;
}

.toast.error {
  background: #b42318;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

#view-dashboard {
  --dashboard-shadow: 0 4px 18px rgba(24, 24, 27, 0.045);
}

#view-dashboard .dashboard-stats {
  gap: 14px;
  margin-bottom: 16px;
}

#view-dashboard .dashboard-stat {
  min-height: 158px;
  padding: 20px;
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: var(--dashboard-shadow);
  overflow: visible;
}

.dashboard-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-stat-label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

#view-dashboard .dashboard-stat > strong {
  min-height: 42px;
  margin-top: 15px;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.18;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#view-dashboard .dashboard-stat .stat-icon {
  position: static;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: #fff8df;
}

#view-dashboard .dashboard-stat .stat-icon svg {
  width: 19px;
  height: 19px;
}

#view-dashboard .dashboard-stat .stat-icon.green {
  color: #15803d;
  background: #ecfdf3;
}

#view-dashboard .stat-trend {
  min-height: 32px;
  margin-top: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 5px;
  color: #15803d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

#view-dashboard .stat-trend svg {
  width: 16px;
  height: 16px;
}

#view-dashboard .stat-trend b {
  font-weight: 750;
}

#view-dashboard .stat-trend.neutral {
  color: #6b7280;
}

#view-dashboard .stat-trend.down {
  color: #dc2626;
}

.dashboard-quick-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dashboard-quick-actions h2 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.dashboard-quick-actions > div {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-quick-actions button {
  min-height: 42px;
  padding: 0 13px;
  border-color: #dfe1e4;
  background: var(--panel);
  box-shadow: none;
  font-size: 13px;
}

.dashboard-quick-actions button:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: #5e4300;
}

#view-dashboard .dashboard-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(390px, 0.75fr);
  gap: 16px;
}

#view-dashboard .panel {
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: var(--dashboard-shadow);
}

#view-dashboard .chart-card,
#view-dashboard .donut-card {
  min-height: 358px;
  padding: 22px;
}

#view-dashboard .card-head {
  margin-bottom: 18px;
}

#view-dashboard .card-head h2,
#view-dashboard .table-titlebar h2 {
  color: var(--ink);
  font-size: 16px;
  text-transform: none;
}

#view-dashboard .mini-select {
  min-height: 38px;
  padding: 0 34px 0 11px;
  color: var(--muted);
  font-size: 12px;
}

#view-dashboard .sales-chart {
  height: 270px;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 30px;
}

#view-dashboard .chart-y {
  padding: 6px 8px 6px 0;
  color: #6b7280;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

#view-dashboard .chart-area {
  border-bottom: 0;
  background: transparent;
  overflow: visible;
}

#view-dashboard .chart-grid-lines line {
  stroke: #e5e7eb;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

#view-dashboard .chart-line circle {
  cursor: help;
  transition: r 120ms ease;
  vector-effect: non-scaling-stroke;
}

#view-dashboard .chart-line circle:hover,
#view-dashboard .chart-line circle:focus {
  r: 8px;
  outline: none;
  stroke: var(--ink);
}

#view-dashboard .chart-x {
  color: #6b7280;
  font-size: 11px;
}

.dashboard-chart-empty {
  min-height: 270px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.dashboard-chart-empty svg {
  width: 30px;
  height: 30px;
  margin-bottom: 3px;
  color: #a7abb2;
}

.dashboard-chart-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.dashboard-chart-empty span {
  font-size: 12px;
}

#view-dashboard .donut-wrap {
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
}

#view-dashboard .donut {
  width: 150px;
  justify-self: center;
}

#view-dashboard .donut.empty {
  background: #ecece8;
}

#view-dashboard .donut-center {
  width: 94px;
}

#view-dashboard .donut-center strong {
  font-size: 28px;
}

#view-dashboard .donut-center span {
  font-size: 12px;
}

#view-dashboard .legend {
  gap: 17px;
}

#view-dashboard .legend-row {
  grid-template-columns: 10px minmax(72px, 1fr) auto;
  gap: 7px;
  font-size: 13px;
}

#view-dashboard .legend-row strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#view-dashboard .dot {
  width: 10px;
  height: 10px;
  background: #16a34a;
}

#view-dashboard .dot.pending {
  background: #e2a924;
}

#view-dashboard .dot.late {
  background: #dc2626;
}

.dashboard-attention {
  margin-bottom: 16px;
}

.dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.dashboard-section-head h2 {
  margin: 0;
  font-size: 16px;
}

.dashboard-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-attention-list {
  display: grid;
}

.dashboard-attention-item {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 18px;
  align-items: center;
  justify-content: initial;
  gap: 11px;
  padding: 10px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.dashboard-attention-item:last-child {
  border-bottom: 0;
}

.dashboard-attention-item:hover {
  border-color: var(--line);
  background: #fafaf8;
}

.dashboard-attention-item:focus-visible {
  z-index: 1;
}

.dashboard-attention-item > strong {
  min-width: 28px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.dashboard-attention-item > svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.dashboard-attention-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #5f636b;
  background: #f2f2ef;
}

.dashboard-attention-icon svg {
  width: 17px;
  height: 17px;
}

.dashboard-attention-item.warning .dashboard-attention-icon {
  color: #8a6300;
  background: #fff8df;
}

.dashboard-attention-item.danger .dashboard-attention-icon {
  color: #dc2626;
  background: #fef2f2;
}

.dashboard-attention-ok {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}

.dashboard-attention-ok > svg {
  width: 30px;
  height: 30px;
  color: #16a34a;
}

.dashboard-attention-ok > span {
  display: grid;
  gap: 3px;
}

.dashboard-attention-ok small {
  color: var(--muted);
}

#view-dashboard .dashboard-latest {
  overflow: hidden;
}

#view-dashboard .table-titlebar {
  padding: 18px 20px;
}

#view-dashboard .dashboard-latest th,
#view-dashboard .dashboard-latest td {
  padding: 14px 16px;
}

#view-dashboard .dashboard-latest tbody tr:hover {
  background: #fafaf8;
}

.dashboard-invoice-mobile-list {
  display: none;
}

.dashboard-invoice-row {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.dashboard-invoice-row-head,
.dashboard-invoice-row-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-invoice-row-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dashboard-invoice-row-head small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.dashboard-invoice-row-head > .amount {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dashboard-invoice-row-meta {
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-invoice-row-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-invoice-row-meta svg {
  width: 15px;
  height: 15px;
}

.dashboard-invoice-row .row-actions {
  justify-content: flex-start;
}

body.dark {
  --bg: #111315;
  --panel: #191c20;
  --panel-2: #24272c;
  --ink: #f4f7fb;
  --muted: #adb1b8;
  --line: #363a40;
  --brand: #e2a924;
  --brand-dark: #f0cb65;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  background: #111315;
}

body.dark input,
body.dark select,
body.dark textarea,
body.dark button:not(.primary):not(.nav-item):not(.link-button):not(.switch) {
  background: #202328;
  color: var(--ink);
  border-color: var(--line);
}

body.dark .button-like,
body.dark .document-style-options span,
body.dark .segmented-choice span,
body.dark .dgii-lookup,
body.dark .expense-fiscal-meta {
  background: #202328;
  color: var(--ink);
  border-color: var(--line);
}

body.dark .document-style-options input:checked + span,
body.dark .segmented-choice input:checked + span {
  background: var(--brand);
  color: #17140c;
}

body.dark .icon-segmented button.active {
  color: #17140c;
}

body.dark .settings-tabs button.active {
  border-color: var(--gold);
  background: #302a1b;
  color: #f0cb65;
}

body.dark .expense-tax-summary .expense-tax-credit {
  background: #102c20;
}

body.dark .expense-confirmation {
  background: #2b2515;
  color: #f8e4ad;
}

body.dark .expense-document-status.fiscal {
  background: #28261e;
  color: #f3dda0;
}

body.dark .field-label,
body.dark .document-style-setting > span {
  color: #c9cbd0;
}

body.dark th {
  background: #17191d;
}

body.dark .date-range,
body.dark .modal-inner,
body.dark .modal-actions,
body.dark .pos-product,
body.dark .donut-center,
body.dark .integration-card,
body.dark .plan-card {
  background: var(--panel);
  color: var(--ink);
}

body.dark .permission-option,
body.dark .permission-axis,
body.dark .permission-check span,
body.dark .permission-overrides,
body.dark .activation-identity,
body.dark .subscription-usage span {
  background: var(--panel-2);
}

body.dark .permission-axis > header,
body.dark .permission-module {
  background: var(--panel);
}

body.dark .settings-business-profile {
  border-color: var(--line);
  background: var(--panel-2);
}

body.dark .settings-business-profile-head p,
body.dark .settings-profile-options small {
  color: #aeb1b7;
}

body.dark .settings-profile-options label {
  border-color: var(--line);
  background: var(--panel);
}

body.dark .settings-profile-options label.selected,
body.dark .settings-profile-options label:has(input:checked) {
  border-color: var(--gold);
  background: #2a261b;
}

body.dark .settings-profile-options label > span {
  background: #302a1a;
  color: var(--gold);
}

body.dark .chart-area {
  background: transparent;
}

body.dark label,
body.dark .client-field,
body.dark .chart-y,
body.dark .chart-x {
  color: #c9cbd0;
}

body.dark .document-preview,
body.dark .document-preview table,
body.dark .document-preview th {
  background: #fff;
  color: #111827;
}

body.dark .dashboard-stat-label,
body.dark #view-dashboard .stat-trend.neutral,
body.dark #view-dashboard .chart-y,
body.dark #view-dashboard .chart-x {
  color: var(--muted);
}

body.dark #view-dashboard .dashboard-stat .stat-icon,
body.dark .dashboard-attention-item.warning .dashboard-attention-icon {
  background: #302a1b;
}

body.dark #view-dashboard .dashboard-stat .stat-icon.green {
  background: #102c20;
}

body.dark .dashboard-attention-item.danger .dashboard-attention-icon {
  background: #351c1c;
}

body.dark .dashboard-attention-icon {
  background: var(--panel-2);
  color: var(--muted);
}

body.dark .dashboard-quick-actions button:hover,
body.dark .dashboard-attention-item:hover,
body.dark #view-dashboard .dashboard-latest tbody tr:hover {
  background: var(--panel-2);
}

body.dark #view-dashboard .chart-grid-lines line {
  stroke: var(--line);
}

body.dark #view-dashboard .donut.empty {
  background: var(--panel-2);
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .main {
    padding: 28px 22px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .pos-layout {
    grid-template-columns: 1fr;
  }

  #view-dashboard .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .integrations-grid,
  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-cart {
    position: static;
  }
}

@media (max-width: 1400px) and (min-width: 1201px) {
  .stat {
    padding: 18px 16px;
  }

  .stat strong {
    font-size: 24px;
  }

  .stat-icon {
    right: 14px;
    width: 54px;
    height: 54px;
  }

  .stat-icon svg {
    width: 28px;
    height: 28px;
  }

  .donut-wrap {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
  }

  .donut {
    width: 150px;
  }

  .donut-center {
    width: 90px;
  }

  .legend {
    gap: 16px;
  }

  .legend-row {
    gap: 8px;
  }
}

@media (max-width: 900px) {
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    height: auto;
    min-height: auto;
    overflow: hidden;
    padding: 12px 16px;
    gap: 10px;
  }

  .main {
    height: auto;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .brand {
    min-height: 52px;
  }

  .brand-logo-window {
    width: 180px;
  }

  .tenant-switcher,
  .sidebar-bottom {
    display: none;
  }

  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .nav-group {
    display: contents;
  }

  .nav-group-title {
    display: none;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 12px;
    font-size: 14px;
    gap: 8px;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-toolbar-actions {
    width: 100%;
  }

  .pos-toolbar-actions .compact-search {
    flex: 1 1 240px;
  }

  .dashboard-grid,
  .donut-wrap {
    grid-template-columns: 1fr;
  }

  #view-dashboard .donut-wrap {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .integrations-grid,
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .document-settings-grid {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .subscription-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .donut-wrap {
    justify-items: center;
  }

  .invoice-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .invoice-line > button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .quick-expense-modal {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .quick-expense-modal .modal-inner {
    max-height: 100dvh;
    padding: 12px;
  }

  .quick-expense-capture {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .quick-expense-capture .expense-receipt-preview {
    width: 100%;
    max-height: 210px;
  }

  .quick-expense-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-expense-actions [data-clear-expense-receipt] {
    grid-column: 1 / -1;
  }

  .quick-expense-fields {
    grid-template-columns: 1fr;
  }

  .quick-expense-fields .span-2 {
    grid-column: 1;
  }

  .permission-module {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 9px;
  }

  .permission-actions {
    justify-content: flex-start;
  }

  .permission-override-control {
    min-width: min(100%, 158px);
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .permission-overrides #userPermissionsMatrix {
    padding: 0 8px 8px;
  }

  .role-explainer > div {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 12px;
  }

  .role-explainer-icon {
    width: 36px;
    height: 36px;
  }

  .copy-field {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .main {
    padding: 20px 12px 28px;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    width: 100%;
  }

  .date-range {
    grid-column: 1 / -1;
    min-height: 44px;
    justify-content: space-between;
    padding: 0 12px;
  }

  .top-actions .primary {
    min-width: 0;
    width: 100%;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  #view-sales {
    padding-bottom: 78px;
    overflow-x: hidden;
  }

  .pos-mobile-switch {
    position: fixed;
    z-index: 12;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  }

  .pos-mobile-switch button {
    min-width: 0;
    min-height: 46px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .pos-mobile-switch button.active {
    background: var(--gold);
    color: #17140c;
  }

  .pos-mobile-switch button strong {
    min-width: 21px;
    height: 21px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(23, 20, 12, 0.12);
    font-size: 11px;
  }

  .pos-mobile-switch button span {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    white-space: nowrap;
  }

  .pos-layout.mobile-catalog .pos-cart {
    display: none;
  }

  .pos-layout.mobile-cart > div:first-child {
    display: none;
  }

  .pos-layout.mobile-cart .pos-cart {
    display: block;
  }

  .pos-layout,
  .pos-layout > div,
  .pos-products {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .pos-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    overflow: hidden;
  }

  .pos-toolbar-actions .compact-search {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .pos-toolbar-actions .icon-segmented {
    width: 78px;
    max-width: 78px;
    justify-self: start;
  }

  .pos-toolbar-actions .icon-segmented button {
    width: 38px;
    min-width: 38px;
  }

  .pos-toolbar-actions > button {
    width: auto;
    min-width: 0;
  }

  body.pos-fullscreen .main,
  body.pos-fullscreen #view-sales,
  body.pos-fullscreen .pos-layout > div {
    max-width: 100vw;
    overflow-x: hidden;
  }

  #view-dashboard .dashboard-stat {
    min-height: 148px;
    padding: 17px;
  }

  #view-dashboard .dashboard-stat > strong {
    min-height: 36px;
    margin-top: 12px;
    font-size: 24px;
  }

  .dashboard-quick-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-quick-actions h2 {
    white-space: normal;
  }

  .dashboard-quick-actions > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: initial;
  }

  .dashboard-quick-actions button {
    min-width: 0;
    width: 100%;
    min-height: 46px;
    padding: 7px 10px;
  }

  .menu-visibility-grid,
  .role-explainer {
    grid-template-columns: 1fr;
  }

  .chart-card,
  .donut-card {
    min-height: 0;
    padding: 16px;
  }

  #view-dashboard .chart-card,
  #view-dashboard .donut-card {
    padding: 16px;
  }

  .chart-card .card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-card .mini-select {
    width: 100%;
  }

  .sales-chart {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  #view-dashboard .sales-chart {
    height: 245px;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .chart-y,
  .chart-x {
    font-size: 11px;
  }

  .chart-x span:nth-child(even) {
    display: none;
  }

  #view-dashboard .donut-wrap {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  #view-dashboard .legend {
    width: min(100%, 320px);
  }

  .dashboard-section-head {
    padding: 16px;
  }

  .dashboard-attention-item {
    grid-template-columns: 32px minmax(0, 1fr) auto 16px;
    padding: 11px 16px;
  }

  #view-dashboard .table-titlebar {
    align-items: flex-start;
    padding: 16px;
  }

  #view-dashboard .table-titlebar .link-button {
    min-height: 32px;
    padding: 0;
    text-align: right;
  }

  .dashboard-invoice-table {
    display: none;
  }

  .dashboard-invoice-mobile-list {
    display: block;
  }

  #view-dashboard .export-row {
    padding: 12px 16px;
  }

  .stat {
    min-height: 158px;
  }

  .toolbar-actions,
  .toolbar-actions button {
    width: 100%;
  }

  .toolbar-actions {
    flex-direction: column;
  }

  .line-actions,
  .line-actions button {
    width: 100%;
  }

  .line-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-product {
    min-height: 150px;
    padding: 0;
  }

  .pos-product-copy {
    padding: 10px;
  }

  .pos-products.view-list .pos-product-copy {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .pos-products.view-list .pos-product-copy > span,
  .pos-products.view-list .pos-product-copy .pos-category,
  .pos-products.view-list .pos-product-copy small:last-child {
    grid-column: 1;
  }

  .cart-line {
    grid-template-columns: minmax(0, 1fr) auto 38px;
  }

  .cart-line > strong {
    grid-column: 1 / -1;
    text-align: right;
  }

  .pos-fields,
  .grid.two,
  .grid.three,
  .grid.four,
  .document-settings-grid,
  .permissions-grid,
  .subscription-usage,
  .doc-meta,
  .doc-parties {
    grid-template-columns: 1fr;
  }

  .integration-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-actions button {
    width: 100%;
  }

  .logo-setting-actions {
    flex-direction: column;
  }

  .logo-setting-actions > * {
    width: 100%;
  }

  .catalog-image-editor {
    grid-template-columns: 1fr;
  }

  .expense-capture {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
  }

  .expense-receipt-preview {
    width: 72px;
    aspect-ratio: 1;
  }

  .expense-receipt-preview span {
    padding: 6px;
    font-size: 0;
  }

  .expense-receipt-preview svg {
    width: 22px;
    height: 22px;
  }

  .expense-capture-copy > small {
    display: none;
  }

  .expense-capture-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 6px;
  }

  .expense-capture-actions > * {
    min-width: 0;
    padding-inline: 7px;
    font-size: 12px;
  }

  .expense-capture-actions #clearExpenseReceipt {
    grid-column: 1 / -1;
  }

  .expense-capture-actions #clearExpenseReceipt:disabled {
    display: none;
  }

  .expense-document-status {
    margin-bottom: 12px;
    padding: 8px 10px;
  }

  .expense-document-status small {
    font-size: 11px;
  }

  .expense-tax-panel {
    margin-block: 14px;
    padding-block: 14px;
  }

  .expense-tax-panel .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .expense-tax-state {
    align-self: flex-start;
  }

  .expense-tax-grid,
  .expense-tax-check {
    grid-template-columns: 1fr;
  }

  #expenseModal .expense-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #expenseModal .expense-details-grid {
    grid-template-columns: 1fr;
  }

  #expenseModal .expense-details-grid .span-2,
  #expenseModal .expense-primary-grid .span-2 {
    grid-column: 1 / -1;
  }

  .expense-extra-details {
    margin-top: 12px;
  }

  .expense-extra-details > summary > small {
    display: none;
  }

  .expense-tax-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-image-editor > .field-label {
    grid-column: auto;
  }

  .catalog-image-preview {
    width: min(180px, 100%);
  }

  .catalog-image-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lookup-row,
  .segmented-choice,
  .expense-tax-summary {
    grid-template-columns: 1fr;
  }

  .expense-breakdown-head,
  .expense-fiscal-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .expense-breakdown-head > button,
  .expense-fiscal-meta > a {
    width: 100%;
    justify-content: center;
  }

  .lookup-row button,
  .expense-capture-actions > * {
    width: 100%;
  }

  .dgii-result {
    grid-template-columns: 1fr;
  }

  .dgii-result > span:last-child {
    text-align: left;
  }

  .product-barcode-row {
    grid-template-columns: 1fr;
  }

  .product-barcode-row button {
    width: 100%;
  }

  .pos-toolbar-actions {
    width: 100%;
  }

  .pos-toolbar-actions .compact-search {
    flex: 1 1 180px;
  }

  .span-2,
  .span-3 {
    grid-column: span 1;
  }

  .invoice-line {
    grid-template-columns: 1fr;
  }

  .form-total {
    align-items: stretch;
    flex-direction: column;
  }

  .form-total span {
    min-width: 0;
    display: flex;
    justify-content: space-between;
  }

  .modal {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .modal-inner {
    padding: 14px;
    max-height: calc(100vh - 12px);
  }

  #expenseModal.modal {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  #expenseModal .modal-inner {
    max-height: 100dvh;
    padding: 12px;
  }

  #expenseModal .modal-head {
    position: sticky;
    z-index: 5;
    top: -12px;
    margin: -12px -12px 12px;
    padding: 12px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
  }

  .modal-actions {
    position: static;
    margin: 18px -14px -14px;
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid var(--line);
  }

  .modal-actions button {
    flex: 1;
  }

  #expenseModal .expense-modal-actions {
    position: sticky;
    z-index: 5;
    bottom: -12px;
    margin: 16px -12px -12px;
    padding: 10px 12px;
    background: var(--panel);
  }

  .scanner-preview {
    min-height: 0;
  }

  .scanner-actions {
    position: static;
    margin: 16px 0 0;
    padding: 0;
    background: transparent;
    border-top: 0;
    flex-direction: column;
  }

  .scanner-actions button {
    width: 100%;
  }

  .document-preview {
    padding: 16px;
  }

  .doc-head {
    flex-direction: column;
  }

  .doc-brand,
  .document-preview.logo-right .doc-brand {
    flex-direction: column;
    text-align: left;
  }

  .doc-title,
  .document-preview.logo-right .doc-title {
    text-align: left;
  }

  .doc-title h3,
  .document-preview.logo-center .doc-title h3,
  .document-preview.logo-right .doc-title h3 {
    justify-content: flex-start;
  }

  .doc-logo {
    max-width: 150px;
    max-height: 62px;
  }

  .document-preview table {
    min-width: 0;
  }

  .document-preview table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .document-preview table tbody {
    display: grid;
    gap: 12px;
  }

  .document-preview table tbody tr {
    display: block;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .document-preview table tbody td {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    width: 100%;
    padding: 5px 0;
    border: 0;
    text-align: right;
  }

  .document-preview table tbody td::before {
    content: attr(data-label);
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
  }

  .document-preview table tbody td:first-child {
    display: block;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    text-align: left;
  }

  .document-preview table tbody td:first-child::before {
    display: none;
  }

  .payment-method-setting {
    grid-template-columns: 1fr 40px;
  }

  .payment-method-setting > label:first-of-type {
    grid-column: 1 / -1;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 420px) {
  .dashboard-quick-actions > div {
    grid-template-columns: 1fr;
  }

  .dashboard-invoice-row-head {
    align-items: flex-start;
  }

  .dashboard-invoice-row-head > .amount {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  body[data-experience-mode="simple"] #view-expenses .compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body[data-experience-mode="simple"] #view-expenses .compact-stats .stat {
    min-height: 118px;
    padding: 16px;
  }

  body[data-experience-mode="simple"] #view-expenses .compact-stats .stat strong {
    margin-top: 8px;
    font-size: 26px;
  }

  body[data-experience-mode="simple"] #view-expenses .compact-stats .stat-icon {
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
  }

  body[data-experience-mode="simple"] #view-expenses .compact-stats .stat-icon svg {
    width: 21px;
    height: 21px;
  }

  #view-expenses .toolbar {
    align-items: stretch;
  }

  #view-expenses .section-tabs {
    width: 100%;
    overflow-x: auto;
  }

  #view-expenses .section-tabs button {
    flex: 1 0 auto;
    justify-content: center;
  }

  #view-expenses .toolbar-actions {
    width: 100%;
  }

  #view-expenses .toolbar-actions > * {
    flex: 1;
    justify-content: center;
  }

  .purchase-desktop-table {
    display: none;
  }

  .purchase-mobile-list {
    display: grid;
    gap: 10px;
  }

  .purchase-mobile-card footer {
    align-items: flex-end;
  }

  .purchase-mobile-card footer .row-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .supplier-payment-summary {
    grid-template-columns: 1fr;
  }

  .purchase-balance-summary {
    grid-template-columns: 1fr;
  }
}

.fiscal-report-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.fiscal-report-tabs {
  display: flex;
  gap: 5px;
  min-width: 0;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.fiscal-report-tabs button {
  flex: 0 0 auto;
  min-width: 136px;
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 9px;
  padding: 7px 12px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.fiscal-report-tabs button strong {
  font-size: 19px;
}

.fiscal-report-tabs button span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.fiscal-report-tabs button.active {
  border-color: #d4a01f;
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.fiscal-report-tabs button.active span {
  color: var(--gold-dark);
}

.fiscal-report-controls {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.fiscal-report-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.fiscal-report-controls input {
  width: 165px;
  min-height: 40px;
}

.fiscal-report-status {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 7px;
  background: var(--panel);
}

.fiscal-report-status > span,
.fiscal-section-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
}

.fiscal-report-status > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.fiscal-report-status small {
  color: var(--muted);
}

.fiscal-report-status.ready {
  border-left-color: var(--ok);
}

.fiscal-report-status.ready > span {
  color: var(--ok);
  background: #e9f8ef;
}

.fiscal-report-status.error {
  border-left-color: var(--accent);
}

.fiscal-report-status.error > span {
  color: var(--accent);
  background: #fff0ee;
}

.fiscal-report-status.zero {
  border-left-color: #667085;
}

.fiscal-report-status.zero > span {
  color: #475467;
  background: var(--panel-2);
}

.fiscal-report-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 14px;
}

.fiscal-report-heading h2,
.fiscal-report-heading p {
  margin: 0;
}

.fiscal-report-heading h2 {
  margin-top: 3px;
  font-size: 22px;
}

.fiscal-report-heading p {
  margin-top: 4px;
  color: var(--muted);
}

.fiscal-period-chip,
.fiscal-record-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  white-space: nowrap;
}

.fiscal-stats {
  margin-bottom: 16px;
}

.fiscal-stat {
  min-width: 0;
}

.fiscal-stat > strong {
  overflow-wrap: anywhere;
}

.fiscal-consumption-summary {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(420px, 1.35fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
  padding: 15px 16px;
  border: 1px solid #d6c27d;
  border-radius: 8px;
  background: var(--gold-soft);
}

.fiscal-consumption-summary > div:first-child {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.fiscal-consumption-summary > div:first-child > div {
  display: grid;
  gap: 3px;
}

.fiscal-consumption-summary small {
  color: #685823;
}

.fiscal-consumption-summary .fiscal-section-icon {
  color: var(--gold-dark);
  background: #fff;
}

.fiscal-consumption-summary dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid #e5d59d;
  border-radius: 7px;
  background: #e5d59d;
}

.fiscal-consumption-summary dl div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  background: #fff;
}

.fiscal-consumption-summary dt {
  color: var(--muted);
  font-size: 11px;
}

.fiscal-consumption-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.fiscal-message-list {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.fiscal-message-head {
  min-height: 44px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
}

.fiscal-message-head span {
  min-width: 27px;
  padding: 2px 7px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
}

.fiscal-message-list.error .fiscal-message-head {
  color: #9b1c13;
  background: #fff3f1;
}

.fiscal-message-list.error .fiscal-message-head span {
  background: #ffd9d5;
}

.fiscal-message-list.warning .fiscal-message-head {
  color: #765600;
  background: var(--gold-soft);
}

.fiscal-message-list.warning .fiscal-message-head span {
  background: #f4df9b;
}

.fiscal-message-list ul {
  max-height: 260px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.fiscal-message-list li {
  display: grid;
  grid-template-columns: minmax(130px, .35fr) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
}

.fiscal-message-list li:last-child {
  border-bottom: 0;
}

.fiscal-message-list li span {
  color: var(--muted);
}

.fiscal-preview-panel {
  margin-bottom: 14px;
}

.fiscal-preview-panel .table-titlebar {
  align-items: center;
}

.fiscal-preview-panel .table-titlebar h2,
.fiscal-preview-panel .table-titlebar p {
  margin: 0;
}

.fiscal-preview-panel .table-titlebar p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.fiscal-preview-table {
  overflow-x: auto;
}

.fiscal-preview-table table {
  min-width: 820px;
}

.fiscal-reason-code {
  display: inline-block;
  min-width: 28px;
  margin-right: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.fiscal-excluded,
.fiscal-adjustments {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.fiscal-excluded {
  margin-bottom: 20px;
}

.fiscal-excluded > summary,
.fiscal-adjustments > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  cursor: pointer;
}

.fiscal-excluded > summary span,
.fiscal-adjustments > summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.fiscal-excluded > div {
  border-top: 1px solid var(--line);
}

.fiscal-excluded p {
  display: grid;
  grid-template-columns: minmax(140px, .35fr) minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
}

.fiscal-excluded p:last-child {
  border-bottom: 0;
}

.fiscal-excluded p span,
.fiscal-adjustments summary small {
  color: var(--muted);
}

.expense-dgii-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #dec979;
  border-radius: 7px;
  background: var(--gold-soft);
}

.expense-dgii-split small {
  grid-column: 1 / -1;
  color: #685823;
}

.fiscal-adjustments .grid {
  padding: 0 13px 13px;
  border-top: 1px solid var(--line);
}

.fiscal-cancel-warning {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #e9c7c3;
  border-radius: 7px;
  background: #fff3f1;
  color: #8f1c14;
}

.fiscal-cancel-warning > span {
  display: grid;
  gap: 3px;
}

.fiscal-cancel-warning small {
  color: #86473f;
}

body.dark .fiscal-report-status.ready > span {
  background: #163424;
}

body.dark .fiscal-report-status.error > span,
body.dark .fiscal-message-list.error .fiscal-message-head,
body.dark .fiscal-cancel-warning {
  background: #351b19;
}

body.dark .fiscal-report-tabs button.active,
body.dark .fiscal-consumption-summary,
body.dark .fiscal-message-list.warning .fiscal-message-head,
body.dark .expense-dgii-split {
  background: #302914;
}

body.dark .fiscal-consumption-summary dl div {
  background: var(--panel);
}

@media (max-width: 900px) {
  .fiscal-report-toolbar,
  .fiscal-report-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .fiscal-report-tabs {
    width: 100%;
  }

  .fiscal-report-tabs button {
    flex: 1 0 130px;
  }

  .fiscal-report-controls {
    width: 100%;
  }

  .fiscal-report-controls label {
    flex: 1;
  }

  .fiscal-report-controls input,
  .fiscal-report-controls button {
    width: 100%;
  }

  .fiscal-consumption-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .fiscal-report-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .fiscal-report-status {
    align-items: start;
  }

  .fiscal-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fiscal-stats .stat {
    min-height: 140px;
    padding: 14px;
  }

  .fiscal-stats .stat > strong {
    font-size: 19px;
    white-space: nowrap;
  }

  .fiscal-consumption-summary {
    padding: 12px;
  }

  .fiscal-consumption-summary dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fiscal-message-list li,
  .fiscal-excluded p {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .fiscal-preview-panel .table-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .fiscal-record-count {
    align-self: flex-start;
  }

  .expense-dgii-split {
    grid-template-columns: 1fr;
  }

  .expense-dgii-split small {
    grid-column: 1;
  }
}

.treasury-forecast {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.treasury-forecast article {
  min-width: 0;
  min-height: 128px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.treasury-forecast article > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.treasury-forecast article > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 25px;
  line-height: 1.1;
}

.treasury-forecast article > small {
  color: var(--muted);
}

.treasury-forecast article:last-child {
  border-color: #d8bb69;
  background: var(--gold-soft);
}

.treasury-forecast article.risk {
  border-color: #e7b1ab;
  background: #fff3f1;
}

.treasury-toolbar {
  align-items: flex-end;
  flex-wrap: wrap;
}

.treasury-toolbar .section-tabs {
  max-width: 100%;
  overflow-x: auto;
}

.treasury-toolbar .toolbar-actions {
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.financial-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.financial-account-card {
  min-width: 0;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.financial-account-card.inactive {
  opacity: .68;
}

.financial-account-card > header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.financial-account-card > header > span:nth-child(2),
.financial-account-balance {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.financial-account-card > header small,
.financial-account-balance small,
.financial-account-balance span {
  color: var(--muted);
}

.financial-account-icon,
.transaction-direction {
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #664a07;
  background: var(--gold-soft);
}

.financial-account-icon {
  width: 42px;
  aspect-ratio: 1;
}

.financial-account-balance {
  flex: 1;
  align-content: center;
  padding: 24px 0;
}

.financial-account-balance strong {
  overflow-wrap: anywhere;
  font-size: 27px;
}

.financial-account-card > footer {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cash-session-pill {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: var(--ok);
  font-size: 13px;
  font-weight: 700;
}

.cash-session-pill svg {
  width: 16px;
  height: 16px;
}

.transaction-direction {
  width: 32px;
  height: 32px;
}

.transaction-direction.in {
  color: #08783a;
  background: #e2f6e9;
}

.transaction-direction.out {
  color: #a42920;
  background: #fee9e6;
}

.positive-amount {
  color: #08783a;
}

.negative-amount {
  color: #a42920;
}

.treasury-mobile-list {
  display: none;
}

.treasury-mobile-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.treasury-mobile-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.treasury-mobile-row small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.treasury-mobile-row > strong {
  max-width: 125px;
  overflow-wrap: anywhere;
  text-align: right;
}

.pos-cash-state {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 12px;
  padding: 10px;
  border: 1px solid #e9c7c3;
  border-radius: 7px;
  color: #8f1c14;
  background: #fff3f1;
}

.pos-cash-state.open {
  border-color: #b9ddc8;
  color: #08783a;
  background: #eef9f2;
}

.pos-cash-state > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pos-cash-state small {
  color: var(--muted);
}

.cash-close-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.cash-close-summary span,
.reconciliation-book-balance {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.cash-close-summary small,
.reconciliation-book-balance small {
  color: var(--muted);
}

.cash-close-summary strong,
.reconciliation-book-balance strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.reconciliation-transactions {
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reconciliation-list-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.reconciliation-list {
  max-height: 320px;
  overflow-y: auto;
}

.reconciliation-list label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.reconciliation-list label:last-child {
  border-bottom: 0;
}

.reconciliation-list input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.reconciliation-list label > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reconciliation-list small {
  color: var(--muted);
}

body.dark .treasury-forecast article:last-child,
body.dark .financial-account-icon {
  background: #302914;
}

body.dark .treasury-forecast article.risk,
body.dark .transaction-direction.out,
body.dark .pos-cash-state {
  background: #351b19;
}

body.dark .transaction-direction.in,
body.dark .pos-cash-state.open {
  background: #163424;
}

.accounting-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
}

.accounting-toolbar .accounting-tabs {
  max-width: 100%;
  overflow-x: auto;
}

.accounting-toolbar .accounting-tabs button {
  flex: 0 0 auto;
  padding-inline: 9px;
  font-size: 13px;
  white-space: nowrap;
}

.accounting-toolbar .toolbar-actions {
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.accounting-filter {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.accounting-filter label {
  min-width: 150px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.accounting-filter input {
  min-height: 38px;
}

.accounting-filter > span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.period-reopen-shortcut {
  min-height: 38px;
  border-color: #d8bb69;
  color: #6b4d08;
  background: var(--gold-soft);
}

.accounting-filter svg {
  width: 16px;
  height: 16px;
  color: var(--gold-dark);
}

.accounting-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.accounting-kpis article {
  min-width: 0;
  min-height: 126px;
  display: grid;
  align-content: space-between;
  gap: 9px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.accounting-kpis article > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.accounting-kpis article > span svg {
  color: var(--gold-dark);
}

.accounting-kpis article > strong {
  min-width: 0;
  overflow: hidden;
  font-size: 21px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-kpis article > small {
  color: var(--muted);
}

.accounting-kpis article > .table-link {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  font-size: 12px;
  text-align: left;
}

.accounting-kpis article:last-child {
  border-color: #d8bb69;
  background: var(--gold-soft);
}

.accounting-kpis article.risk {
  border-color: #e7b1ab;
  background: #fff3f1;
}

.accounting-health {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 10px 14px;
  border: 1px solid #b9ddc8;
  border-radius: 8px;
  color: #08783a;
  background: #eef9f2;
}

.accounting-health.warning {
  border-color: #e9c7c3;
  color: #8f1c14;
  background: #fff3f1;
}

.accounting-health > svg {
  width: 25px;
  height: 25px;
}

.accounting-health > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.accounting-health small {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading h2 {
  font-size: 18px;
}

.section-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.table-link {
  min-height: auto;
  padding: 0;
  border: 0;
  color: var(--brand-dark);
  background: transparent;
  box-shadow: none;
  font-weight: 800;
}

.table-link:hover {
  border-color: transparent;
  text-decoration: underline;
}

.ledger-selector {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(150px, auto));
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.ledger-selector label,
.ledger-selector > span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.ledger-selector label,
.ledger-selector small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ledger-selector > span {
  padding: 0 8px 7px;
  text-align: right;
}

.ledger-selector strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.financial-statement {
  display: grid;
  gap: 18px;
}

.financial-statement > header {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-top: 3px solid var(--gold);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.financial-statement > header span {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.financial-statement > header h2,
.financial-statement > header p,
.financial-statement section h3 {
  margin: 0;
}

.financial-statement > header p {
  margin-top: 4px;
  color: var(--muted);
}

.financial-statement > header > strong {
  min-width: 180px;
  overflow-wrap: anywhere;
  font-size: 28px;
  text-align: right;
}

.financial-statement section h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.financial-statement > footer,
.balance-sheet section > footer,
.balance-result-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-top: 2px solid var(--ink);
  background: var(--panel);
}

.financial-statement > footer strong,
.balance-sheet section > footer strong {
  overflow-wrap: anywhere;
  font-size: 21px;
}

.balance-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.balance-sheet > section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.balance-sheet h2,
.balance-sheet h3 {
  margin: 0;
  padding: 14px 16px;
}

.balance-sheet h2 {
  border-bottom: 2px solid var(--gold);
  font-size: 18px;
}

.balance-sheet h3 {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.balance-sheet .panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.balance-sheet table {
  min-width: 0;
  table-layout: fixed;
}

.balance-sheet th:first-child,
.balance-sheet td:first-child {
  width: 90px;
}

.balance-sheet th:last-child,
.balance-sheet td:last-child {
  width: 160px;
  white-space: nowrap;
}

.balance-result-row {
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.entry-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px;
  border-left: 4px solid var(--gold);
  background: var(--panel-2);
}

.entry-detail-heading h3,
.entry-detail-heading small {
  margin: 3px 0 0;
}

.entry-detail-heading h3 {
  font-size: 18px;
}

.entry-detail-heading > div > span {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
}

.entry-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.entry-detail-heading small {
  display: block;
  color: var(--muted);
}

.entry-detail-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(120px, auto));
  gap: 14px;
  padding: 13px 14px;
  border-top: 2px solid var(--ink);
  text-align: right;
}

.entry-detail-total span {
  text-align: left;
}

.journal-lines-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
}

.journal-lines-heading > div {
  display: grid;
  gap: 2px;
}

.journal-lines-heading small {
  color: var(--muted);
}

.journal-entry-lines {
  display: grid;
  gap: 8px;
}

.journal-entry-line {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(110px, .7fr) minmax(110px, .7fr) minmax(180px, 1fr) 38px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.journal-entry-line label {
  min-width: 0;
}

.journal-entry-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.journal-entry-totals > span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.journal-entry-totals small {
  color: var(--muted);
}

.journal-entry-totals strong {
  overflow-wrap: anywhere;
}

.journal-entry-totals .balanced {
  border-color: #b9ddc8;
  color: #08783a;
  background: #eef9f2;
}

.journal-entry-totals .warning {
  border-color: #e9c7c3;
  color: #8f1c14;
  background: #fff3f1;
}

body.dark .accounting-kpis article:last-child {
  background: #302914;
}

body.dark .accounting-kpis article.risk,
body.dark .accounting-health.warning,
body.dark .journal-entry-totals .warning {
  background: #351b19;
}

body.dark .accounting-health,
body.dark .journal-entry-totals .balanced {
  background: #163424;
}

@media (max-width: 1100px) {
  .treasury-forecast,
  .accounting-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .financial-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .treasury-toolbar,
  .accounting-toolbar {
    align-items: stretch;
  }

  .treasury-toolbar .section-tabs,
  .accounting-toolbar .section-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .treasury-toolbar .section-tabs button,
  .accounting-toolbar .section-tabs button {
    flex: 0 0 auto;
  }

  .accounting-toolbar .toolbar-actions {
    width: 100%;
    margin-left: 0;
  }

  .accounting-toolbar .toolbar-actions button {
    flex: 1 1 170px;
    width: auto;
  }

  .balance-sheet {
    grid-template-columns: 1fr;
  }

  .journal-entry-line {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 38px;
  }

  .journal-entry-line label:first-child,
  .journal-entry-line label:nth-child(4) {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .treasury-forecast,
  .financial-account-grid,
  .accounting-kpis {
    grid-template-columns: 1fr;
  }

  .balance-sheet table {
    min-width: 500px;
  }

  .treasury-forecast article,
  .accounting-kpis article {
    min-height: 110px;
  }

  .financial-account-card {
    min-height: 210px;
  }

  .financial-account-card > header {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .financial-account-card > header .badge {
    grid-column: 2;
    justify-self: start;
  }

  .treasury-desktop-table {
    display: none;
  }

  .treasury-mobile-list {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .cash-close-summary {
    grid-template-columns: 1fr;
  }

  .reconciliation-list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .reconciliation-list label {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .reconciliation-list label > b {
    grid-column: 2;
    justify-self: start;
  }

  .pos-cash-state {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .pos-cash-state button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .accounting-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .accounting-filter label {
    min-width: 0;
    width: 100%;
  }

  .accounting-filter > span {
    min-height: 30px;
    margin-left: 0;
  }

  .period-reopen-shortcut {
    width: 100%;
  }

  .accounting-toolbar .toolbar-actions,
  .accounting-toolbar .toolbar-actions button {
    width: 100%;
  }

  .accounting-toolbar .toolbar-actions button {
    flex: 0 0 auto;
  }

  .ledger-selector {
    grid-template-columns: 1fr 1fr;
  }

  .ledger-selector label {
    grid-column: 1 / -1;
  }

  .ledger-selector > span {
    padding: 0;
    text-align: left;
  }

  .financial-statement > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .financial-statement > header > strong {
    min-width: 0;
    text-align: left;
  }

  .journal-lines-heading,
  .entry-detail-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .journal-lines-heading button,
  .entry-detail-heading button {
    width: 100%;
  }

  .entry-detail-actions {
    width: 100%;
    justify-content: stretch;
  }

  .journal-entry-line {
    grid-template-columns: 1fr 38px;
  }

  .journal-entry-line label,
  .journal-entry-line label:first-child,
  .journal-entry-line label:nth-child(4) {
    grid-column: 1;
  }

  .journal-entry-line button {
    grid-column: 2;
    grid-row: 1;
  }

  .journal-entry-totals {
    grid-template-columns: 1fr;
  }

  .entry-detail-total {
    grid-template-columns: 1fr 1fr;
  }

  .entry-detail-total span {
    grid-column: 1 / -1;
  }
}

.notification-center {
  position: relative;
  margin-left: auto;
}

.notification-center .icon-button {
  position: relative;
  background: var(--panel);
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 30;
  width: min(390px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 50px rgb(15 23 42 / 18%);
}

.notification-popover > header,
.notification-popover > footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.notification-popover > header > span {
  display: grid;
  gap: 2px;
}

.notification-popover > header small,
.notification-item small,
.notification-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.notification-popover > header button,
.notification-popover > footer button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

.notification-popover > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.notification-list {
  max-height: 470px;
  overflow-y: auto;
}

.notification-item {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}

.notification-item:hover,
.notification-item.unread {
  background: var(--gold-soft);
}

.notification-item > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.notification-item strong,
.notification-item small {
  overflow-wrap: anywhere;
}

.notification-severity {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--brand);
  background: var(--gold-soft);
}

.notification-severity.warning {
  color: #9a6700;
  background: #fff4ce;
}

.notification-severity.critical {
  color: var(--accent);
  background: #fff0ef;
}

.purchase-mode-field,
.purchase-items-editor {
  margin-bottom: 16px;
}

.purchase-items-editor {
  padding-top: 4px;
}

.purchase-item-head,
.purchase-item-row {
  display: grid;
  grid-template-columns: minmax(250px, 2fr) minmax(90px, 0.55fr) minmax(110px, 0.7fr) 80px minmax(105px, 0.7fr) 40px;
  gap: 8px;
  align-items: center;
}

.purchase-item-head {
  padding: 8px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.purchase-item-row {
  position: relative;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.purchase-item-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.purchase-item-identity select,
.purchase-item-identity input,
.purchase-item-field,
.purchase-item-field input,
.purchase-item-tax,
.purchase-item-tax select {
  min-width: 0;
}

.purchase-item-field,
.purchase-item-tax {
  display: grid;
}

.purchase-item-field > span,
.purchase-item-tax > span {
  display: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.purchase-discount-field {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr);
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.purchase-discount-field input {
  min-height: 34px;
}

.compact-check {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.compact-check input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 0;
  accent-color: var(--gold);
}

.purchase-item-row > strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.purchase-received-copy {
  grid-column: 1 / -1;
  color: var(--ok);
  font-size: 11px;
}

.purchase-item-totals,
.bank-import-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.purchase-item-totals span,
.bank-import-summary span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.purchase-item-totals strong,
.bank-import-summary strong {
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.purchase-receive-lines {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.purchase-receive-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.purchase-receive-line > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.purchase-receive-line small {
  color: var(--muted);
}

.bank-import-help {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
}

.bank-import-help > svg {
  color: var(--brand);
}

.bank-import-help > span {
  display: grid;
  gap: 3px;
}

.bank-import-help small {
  color: var(--muted);
}

.file-drop-field input[type="file"] {
  padding: 8px;
  border: 1px dashed #a8a9a7;
  background: var(--panel-2);
}

.bank-import-table {
  max-height: 52vh;
  margin-top: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.bank-import-line {
  min-width: 800px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px minmax(270px, 1.5fr) 115px 55px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.bank-import-line:last-child {
  border-bottom: 0;
}

.bank-import-line > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.bank-import-line small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-import-line > b,
.match-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.match-score {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.automation-rule-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.automation-rule {
  min-height: 68px;
  display: grid;
  grid-template-columns: 24px minmax(220px, 1fr) auto minmax(100px, auto);
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: var(--panel);
}

.automation-rule > input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold);
}

.automation-rule > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.automation-rule small,
.automation-rule em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.automation-days {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.automation-days input {
  width: 68px;
  min-height: 36px;
}

.inventory-tabs {
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.transfer-product {
  display: block;
  line-height: 1.45;
}

.transfer-product + .transfer-product {
  margin-top: 4px;
}

.transfer-lines {
  margin-top: 22px;
}

.transfer-line {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(170px, 1fr) minmax(130px, 0.65fr) 42px;
  gap: 12px;
  align-items: end;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.transfer-line:first-child {
  border-top: 0;
}

.transfer-line > .icon-button {
  margin-bottom: 1px;
}

.purchase-order-lines {
  margin-top: 22px;
}

.purchase-order-line {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) repeat(4, minmax(105px, 0.65fr)) minmax(120px, 0.7fr) 42px;
  gap: 10px;
  align-items: end;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.purchase-order-line:first-child {
  border-top: 0;
}

.purchase-order-line-total {
  display: grid;
  gap: 5px;
  min-height: 42px;
  align-content: center;
  text-align: right;
}

.purchase-order-line-total small {
  color: var(--muted);
}

.asset-kpis {
  margin-bottom: 22px;
}

.asset-run-heading {
  margin-top: 28px;
}

@media (max-width: 760px) {
  .inventory-tabs {
    margin-inline: -4px;
    padding-bottom: 4px;
  }

  .inventory-tabs button {
    flex: 0 0 auto;
  }

  .transfer-line {
    grid-template-columns: 1fr 42px;
    padding: 16px 0;
  }

  .purchase-order-line {
    grid-template-columns: 1fr 1fr 42px;
    gap: 12px;
    padding: 16px 0;
  }

  .purchase-order-line label:first-child {
    grid-column: 1 / -1;
  }

  .purchase-order-line-total {
    grid-column: 1 / 3;
    text-align: left;
  }

  .purchase-order-line > .icon-button {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .transfer-line label {
    grid-column: 1 / -1;
  }

  .transfer-line > .icon-button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
}

.hr-stats,
.payroll-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hr-stats .stat,
.payroll-stats .stat {
  min-height: 136px;
  padding: 18px;
}

.hr-stats .stat strong,
.payroll-stats .stat strong {
  max-width: calc(100% - 64px);
  margin-top: 14px;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.hr-stats .stat-icon,
.payroll-stats .stat-icon {
  right: 16px;
  bottom: 16px;
  width: 52px;
  height: 52px;
}

.hr-stats .stat-icon svg,
.payroll-stats .stat-icon svg {
  width: 25px;
  height: 25px;
}

.stat-icon.amber {
  color: #9a6700;
  background: #fff3ce;
}

.payroll-row-actions {
  min-width: 185px;
  white-space: nowrap;
}

.payroll-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 14px;
}

.payroll-settings-layout h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

.payroll-settings-layout .settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.payroll-rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.payroll-rate-grid span,
.payroll-cap-list span,
.payroll-detail-stats span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.payroll-rate-grid small,
.payroll-cap-list small,
.payroll-detail-stats small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.payroll-rate-grid strong,
.payroll-cap-list strong,
.payroll-detail-stats strong {
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.payroll-cap-list {
  display: grid;
  gap: 8px;
}

.payroll-employee-editor {
  min-width: 0;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.payroll-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.payroll-editor-head h3,
.payroll-editor-head p {
  margin: 0;
}

.payroll-editor-head h3 {
  font-size: 15px;
}

.payroll-editor-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.payroll-editor-scroll {
  max-height: min(48vh, 490px);
  overflow: auto;
}

.payroll-editor-scroll table {
  min-width: 1220px;
}

.payroll-editor-scroll thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.payroll-editor-scroll th,
.payroll-editor-scroll td {
  padding: 9px 8px;
}

.payroll-editor-scroll th:first-child,
.payroll-editor-scroll td:first-child {
  width: 62px;
  text-align: center;
}

.payroll-editor-scroll th:nth-child(2),
.payroll-editor-scroll td:nth-child(2) {
  width: 220px;
}

.payroll-editor-scroll td:nth-child(2) small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.payroll-editor-scroll input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--gold);
}

.payroll-editor-scroll input[type="number"] {
  min-width: 100px;
}

.payroll-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.payroll-detail-head h2,
.payroll-detail-head p {
  margin: 0;
}

.payroll-detail-head h2 {
  margin-top: 5px;
  font-size: 22px;
}

.payroll-detail-head p {
  margin-top: 5px;
  color: var(--muted);
}

.payroll-detail-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.payroll-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.payroll-detail-table {
  border: 1px solid var(--line);
  border-radius: 7px;
}

.payroll-payment-history,
.payroll-notes {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.payroll-payment-history summary {
  cursor: pointer;
  font-weight: 700;
}

.payroll-payment-history > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  color: var(--muted);
}

.payroll-payment-history > div strong {
  color: var(--ink);
}

.payroll-notes p {
  margin: 5px 0 0;
}

@media (max-width: 900px) {
  .notification-center {
    position: absolute;
    top: 16px;
    right: 16px;
  }

  .topbar > div:first-child {
    padding-right: 50px;
  }

  .purchase-item-head {
    display: none;
  }

  .purchase-item-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 40px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-2);
  }

  .purchase-item-identity {
    grid-column: 1 / -1;
  }

  .purchase-item-field,
  .purchase-item-tax {
    width: 100%;
  }

  .purchase-item-field > span,
  .purchase-item-tax > span {
    display: block;
    margin-bottom: 4px;
  }

  .purchase-item-row > .purchase-item-tax {
    grid-column: 1;
  }

  .purchase-item-row > strong {
    grid-column: 2;
  }

  .purchase-item-row > button {
    grid-column: 3;
    grid-row: 2;
  }

  .automation-rule {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .automation-rule > span:nth-child(2) {
    grid-column: 2;
  }

  .automation-days,
  .automation-rule > em {
    grid-column: 2;
    justify-self: start;
  }

  .hr-stats,
  .payroll-stats {
    grid-template-columns: 1fr;
  }

  #view-hr .toolbar,
  #view-payroll .toolbar,
  .payroll-settings-layout .settings-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #view-hr .section-tabs,
  #view-payroll .section-tabs {
    width: 100%;
    overflow-x: auto;
  }

  #view-hr .section-tabs button,
  #view-payroll .section-tabs button {
    flex: 0 0 auto;
  }

  .payroll-settings-layout {
    grid-template-columns: 1fr;
  }

  .payroll-detail-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .notification-popover {
    position: fixed;
    top: 76px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 94px);
  }

  .purchase-item-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .purchase-item-field,
  .purchase-item-row > .compact-check,
  .purchase-item-row > strong {
    grid-column: 1 / -1;
  }

  .purchase-item-row > strong {
    text-align: left;
  }

  .purchase-item-row > button {
    grid-column: 2;
    grid-row: 2;
  }

  .purchase-item-totals,
  .bank-import-summary {
    grid-template-columns: 1fr;
  }

  .purchase-receive-line {
    grid-template-columns: 1fr;
  }

  .bank-import-line {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bank-import-line select {
    grid-column: 1 / -1;
  }

  .bank-import-line .status,
  .match-score {
    justify-self: start;
  }

  .hr-stats .stat,
  .payroll-stats .stat {
    min-height: 112px;
  }

  .payroll-rate-grid,
  .payroll-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-editor-head,
  .payroll-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .payroll-editor-head button,
  .payroll-detail-actions button {
    width: 100%;
  }

  .payroll-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .payroll-payment-history > div {
    display: grid;
  }
}

body.onboarding-open {
  overflow: hidden;
}

#onboardingRoot {
  position: fixed;
  z-index: 5000;
  inset: 0;
  overflow: auto;
  background: #f5f6f3;
}

.onboarding-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100%;
  margin: 0 auto;
  padding: 28px 0 40px;
}

.onboarding-top {
  display: grid;
  grid-template-columns: 180px minmax(220px, 440px) 180px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
  padding: 7px 18px;
  border-radius: 8px;
  background: #191b17;
}

.onboarding-top > img {
  display: block;
  width: 154px;
  height: 50px;
  object-fit: contain;
  object-position: left center;
}

.onboarding-top > small {
  overflow: hidden;
  color: #f3f4f0;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-progress {
  display: flex;
  align-items: center;
}

.onboarding-progress span {
  display: flex;
  flex: 1;
  align-items: center;
}

.onboarding-progress b {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #55594f;
  border-radius: 50%;
  background: #292c26;
  color: #d8dbd3;
  font-size: 12px;
}

.onboarding-progress i {
  width: 100%;
  height: 2px;
  background: #55594f;
}

.onboarding-progress span:last-child {
  flex: 0 0 30px;
}

.onboarding-progress span:last-child i {
  display: none;
}

.onboarding-progress span.active b {
  border-color: #e2a924;
  background: #e2a924;
  color: #171914;
}

.onboarding-progress span.active i {
  background: #e2a924;
}

.onboarding-card {
  display: flex;
  min-height: 650px;
  margin-top: 26px;
  flex-direction: column;
  border: 1px solid #e1e3de;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgb(27 31 24 / 8%);
}

.onboarding-content {
  width: min(990px, calc(100% - 64px));
  margin: 0 auto;
  padding: 54px 0 38px;
}

.onboarding-heading {
  max-width: 710px;
  margin-bottom: 34px;
}

.onboarding-kicker {
  display: block;
  margin-bottom: 9px;
  color: #9a7415;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.onboarding-heading h1 {
  margin: 0;
  color: #171914;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.onboarding-heading p {
  margin: 10px 0 0;
  color: #667085;
  font-size: 16px;
  line-height: 1.5;
}

.business-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.business-profile-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 224px;
  padding: 20px;
  align-items: flex-start;
  flex-direction: column;
  border: 1px solid #dde1d9;
  border-radius: 8px;
  background: #fff;
  color: #171914;
  text-align: left;
}

.business-profile-card:hover {
  border-color: #b8aa7b;
  background: #fffdf7;
}

.business-profile-card.selected {
  border-color: #e2a924;
  box-shadow: 0 0 0 2px rgb(226 169 36 / 18%);
}

.business-profile-card > span {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 8px;
  background: #f4eedf;
  color: #8b6812;
}

.business-profile-card > span svg {
  width: 21px;
  height: 21px;
}

.business-profile-card strong {
  font-size: 16px;
}

.business-profile-card small {
  margin-top: 7px;
  color: #667085;
  line-height: 1.45;
}

.business-profile-card em {
  margin-top: auto;
  padding-top: 16px;
  color: #777b73;
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.business-profile-card .profile-check {
  position: absolute;
  top: 16px;
  right: 16px;
  display: none;
  width: 20px;
  color: #9a7415;
}

.business-profile-card.selected .profile-check {
  display: block;
}

.onboarding-activity {
  display: block;
  max-width: 650px;
  margin: 28px auto 0;
  color: #344054;
  font-weight: 700;
}

.onboarding-activity input {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
}

.onboarding-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.onboarding-form-grid label,
.onboarding-account-grid label,
.settings-profile-actions label {
  color: #344054;
  font-weight: 700;
}

.onboarding-form-grid input,
.onboarding-form-grid select,
.onboarding-account-grid input,
.settings-profile-actions input {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
}

.onboarding-payment-methods {
  display: grid;
  margin-top: 26px;
  padding: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  border: 0;
}

.onboarding-payment-methods legend {
  margin-bottom: 10px;
  color: #344054;
  font-weight: 800;
}

.onboarding-payment-methods label {
  min-width: 0;
  cursor: pointer;
}

.onboarding-payment-methods input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.onboarding-payment-methods span {
  display: flex;
  min-height: 48px;
  padding: 9px 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid #dde1d9;
  border-radius: 6px;
  color: #5f665b;
  font-size: 12px;
  font-weight: 700;
}

.onboarding-payment-methods input:checked + span {
  border-color: #e2a924;
  background: #fff9e8;
  color: #59430e;
}

.onboarding-payment-methods svg {
  flex: 0 0 18px;
  width: 18px;
}

.onboarding-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.onboarding-account-grid section {
  display: grid;
  padding: 18px;
  grid-template-columns: 44px repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
  border: 1px solid #e1e3de;
  border-radius: 8px;
  background: #fafbf9;
}

.onboarding-account-grid section > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #f4eedf;
  color: #8b6812;
}

.onboarding-import-grid {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.onboarding-import-card {
  display: grid;
  min-width: 0;
  padding: 18px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 5px 12px;
  border: 1px solid #e1e3de;
  border-radius: 8px;
}

.onboarding-import-card.ready {
  border-color: #77ab94;
  background: #f7fcf9;
}

.onboarding-import-icon {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: 1;
  place-items: center;
  border-radius: 8px;
  background: #f0f2ed;
  color: #50584d;
}

.onboarding-import-card > div {
  min-width: 0;
}

.onboarding-import-card strong,
.onboarding-import-card small {
  display: block;
}

.onboarding-import-card small {
  margin-top: 3px;
  color: #777e74;
  line-height: 1.35;
}

.onboarding-file-button {
  display: flex;
  min-height: 38px;
  margin-top: 12px;
  padding: 0 11px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid #d5d9d1;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.onboarding-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.onboarding-file-button svg,
.onboarding-import-card .link-button svg {
  width: 16px;
}

.onboarding-file-name {
  overflow: hidden;
  grid-column: 1 / -1;
  color: #49755f;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-import-card .link-button {
  min-height: 32px;
  padding: 0;
  grid-column: 1 / -1;
  justify-content: flex-start;
  color: #82610f;
  font-size: 11px;
}

.onboarding-import-note,
.onboarding-final-note {
  display: flex;
  margin-top: 18px;
  padding: 14px 16px;
  align-items: center;
  gap: 12px;
  border-radius: 6px;
  background: #f4f6f2;
  color: #4e564b;
}

.onboarding-import-note > svg,
.onboarding-final-note > svg {
  flex: 0 0 22px;
  color: #4a8069;
}

.onboarding-import-note strong,
.onboarding-import-note small {
  display: block;
}

.onboarding-import-note small {
  margin-top: 2px;
  color: #788075;
}

.onboarding-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.onboarding-summary section {
  display: grid;
  min-width: 0;
  min-height: 112px;
  padding: 18px;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid #e1e3de;
  border-radius: 8px;
}

.onboarding-summary section > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #f4eedf;
  color: #8b6812;
}

.onboarding-summary small,
.onboarding-summary strong,
.onboarding-summary em {
  display: block;
  overflow-wrap: anywhere;
}

.onboarding-summary small {
  color: #7b8177;
}

.onboarding-summary strong {
  margin-top: 3px;
  color: #252923;
  font-size: 16px;
}

.onboarding-summary em {
  margin-top: 3px;
  color: #697067;
  font-size: 12px;
  font-style: normal;
}

.onboarding-actions {
  display: flex;
  min-height: 76px;
  margin-top: auto;
  padding: 14px 32px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e6e8e3;
}

.onboarding-error {
  width: min(990px, calc(100% - 64px));
  margin: 0 auto 12px;
  padding: 10px 14px;
  border: 1px solid #e2b1ad;
  border-radius: 6px;
  background: #fff3f2;
  color: #9b251d;
  font-size: 13px;
  font-weight: 700;
}

.onboarding-actions button {
  min-width: 124px;
  min-height: 44px;
}

.onboarding-blocked {
  display: flex;
  max-width: 520px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.onboarding-blocked > img {
  width: 170px;
  margin-bottom: 56px;
}

.onboarding-blocked > span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: #f4eedf;
  color: #8b6812;
}

.onboarding-blocked h1 {
  margin: 20px 0 8px;
}

.onboarding-blocked p {
  max-width: 420px;
  margin: 0;
  color: #667085;
}

.settings-business-profile {
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid #e0e3dc;
  border-radius: 8px;
  background: #fafbf9;
}

.settings-business-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.settings-business-profile-head span:first-child {
  color: #8b6812;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-business-profile-head h3 {
  margin: 3px 0;
  font-size: 18px;
}

.settings-business-profile-head p {
  margin: 0;
  color: #747b71;
}

.settings-profile-options {
  display: grid;
  margin-top: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.settings-profile-options label {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 126px;
  padding: 14px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-content: start;
  gap: 6px 10px;
  border: 1px solid #dfe2db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.settings-profile-options label.selected,
.settings-profile-options label:has(input:checked) {
  border-color: #e2a924;
  background: #fffaf0;
}

.settings-profile-options input {
  position: absolute;
  opacity: 0;
}

.settings-profile-options label > span {
  display: grid;
  width: 34px;
  height: 34px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 6px;
  background: #f3eee1;
  color: #8b6812;
}

.settings-profile-options strong {
  align-self: end;
  font-size: 13px;
}

.settings-profile-options small {
  grid-column: 2;
  color: #737a70;
  line-height: 1.35;
}

.settings-profile-actions {
  display: grid;
  margin-top: 14px;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.settings-profile-actions button {
  min-height: 46px;
}

.project-portfolio-metrics,
.project-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.project-portfolio-metrics article,
.project-metric-grid article {
  display: flex;
  min-width: 0;
  min-height: 98px;
  padding: 18px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(23, 25, 29, 0.04);
}

.project-portfolio-metrics article > svg {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 7px;
  color: #7b5a0c;
  background: var(--gold-soft);
}

.project-portfolio-metrics span,
.project-metric-grid article {
  min-width: 0;
}

.project-portfolio-metrics small,
.project-metric-grid span,
.project-metric-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.project-portfolio-metrics strong,
.project-metric-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 22px;
}

.project-portfolio-metrics article.attention > svg,
.project-metric-grid article.negative {
  color: #9c251b;
  background: #fff0ee;
}

.project-metric-grid article {
  display: block;
}

.project-metric-grid article.positive {
  border-top: 3px solid var(--ok);
}

.project-metric-grid article.negative {
  border-top: 3px solid var(--accent);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  align-items: start;
  gap: 16px;
}

.project-grid > .empty {
  grid-column: 1 / -1;
}

.project-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid var(--project-color);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(23, 25, 29, 0.05);
}

.project-card-main {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 18px;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.project-card-main:hover {
  background: color-mix(in srgb, var(--panel) 92%, var(--gold) 8%);
}

.project-card-main > strong,
.project-card-main > small {
  display: block;
}

.project-card-main > strong {
  margin-top: 18px;
  font-size: 17px;
}

.project-card-main > small {
  min-height: 20px;
  margin-top: 4px;
  color: var(--muted);
}

.project-card-top,
.project-card-stats,
.project-card > footer {
  display: flex;
  align-items: center;
}

.project-card-top {
  justify-content: space-between;
  gap: 12px;
}

.project-card-top > b {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

.project-status,
.project-priority {
  padding: 4px 7px;
  border-radius: 5px;
  color: #5c480f;
  background: var(--gold-soft);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  text-transform: uppercase;
}

.project-status.completed,
.project-priority.low {
  color: #096b34;
  background: #eaf7ef;
}

.project-status.cancelled,
.project-priority.critical {
  color: #9c251b;
  background: #fff0ee;
}

.project-status.on_hold,
.project-priority.high {
  color: #8a5400;
  background: #fff3da;
}

.project-progress {
  display: block;
  width: 100%;
  height: 7px;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--panel-2);
}

.project-progress > i,
.project-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--project-color, var(--gold));
}

.project-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.project-card-stats > span {
  min-width: 0;
}

.project-card-stats small,
.project-card-stats b {
  display: block;
  overflow-wrap: anywhere;
}

.project-card-stats small {
  color: var(--muted);
  font-size: 10px;
}

.project-card-stats b {
  margin-top: 3px;
  font-size: 12px;
}

.negative-text {
  color: var(--accent);
}

.project-card > footer {
  min-height: 48px;
  padding: 8px 10px 8px 18px;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.project-card > footer > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card > footer > span:nth-child(2) {
  flex: 1;
}

.project-card > footer svg {
  width: 14px;
  height: 14px;
}

.project-detail-head {
  display: grid;
  grid-template-columns: 40px 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.project-color {
  width: 10px;
  height: 52px;
  border-radius: 4px;
  background: var(--project-color);
}

.project-detail-head h2 {
  margin: 2px 0;
  font-size: 25px;
}

.project-detail-head p,
.project-detail-head > div > span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.project-detail-actions,
.project-floating-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-tabs {
  overflow-x: auto;
}

.project-tabs button {
  white-space: nowrap;
}

.project-tab-content {
  padding-top: 16px;
}

.project-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr);
  gap: 16px;
}

.project-overview-panel,
.project-team-panel,
.project-activity-panel {
  padding: 20px;
}

.project-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 0;
}

.project-facts div {
  min-width: 0;
}

.project-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.project-facts dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.project-description {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.project-team-list {
  display: grid;
  gap: 9px;
}

.project-team-list > span {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}

.project-team-list b {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #1d190d;
  background: var(--gold-soft);
  font-size: 10px;
}

.project-activity-panel {
  margin-top: 16px;
}

.project-activity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.project-activity-grid > span {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
}

.project-activity-grid svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  grid-row: 1 / 3;
  border-radius: 7px;
  color: #7b5a0c;
  background: var(--gold-soft);
}

.project-activity-grid small {
  color: var(--muted);
  font-size: 11px;
}

.project-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.project-kanban-column {
  min-width: 230px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.project-kanban-column > header {
  display: flex;
  min-height: 34px;
  padding: 0 4px 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 750;
}

.project-kanban-column > header b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--panel);
  font-size: 10px;
}

.project-task-list {
  display: grid;
  align-content: start;
  gap: 9px;
}

.project-task-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.project-task-card > div:first-child,
.project-task-card > footer,
.project-task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-task-card > div:first-child {
  justify-content: space-between;
}

.project-task-card > strong {
  display: block;
  margin-top: 11px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.project-task-card > p {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pos-product-list-price {
  display: none;
}

.project-task-card time {
  color: var(--muted);
  font-size: 10px;
}

.project-task-card time.late {
  color: var(--accent);
  font-weight: 700;
}

.project-task-card > footer {
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.project-task-card > footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-task-card > footer svg {
  width: 13px;
  height: 13px;
}

.project-task-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.project-task-actions select {
  min-width: 0;
  height: 34px;
  flex: 1;
}

.project-task-actions .square-action {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.project-kanban-empty {
  padding: 18px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.project-finance-grid {
  display: grid;
  gap: 22px;
}

.project-files-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-file-item {
  display: grid;
  min-width: 0;
  min-height: 66px;
  padding: 10px 10px 10px 14px;
  grid-template-columns: 36px minmax(0, 1fr) repeat(3, 38px);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.project-file-item > svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 7px;
  color: #7b5a0c;
  background: var(--gold-soft);
}

.project-file-item span,
.project-file-item strong,
.project-file-item small {
  display: block;
  min-width: 0;
}

.file-title-link {
  min-width: 0;
  min-height: 0;
  display: block;
  padding: 4px 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.file-title-link:hover,
.file-title-link:focus-visible {
  color: var(--gold-dark);
  background: transparent;
}

.project-file-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-file-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.file-viewer-modal .modal-inner {
  width: min(1100px, calc(100vw - 32px));
}

.file-viewer-stage {
  min-height: min(70vh, 720px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.file-viewer-stage img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.file-viewer-stage iframe {
  width: 100%;
  min-height: min(72vh, 760px);
  border: 0;
  background: #fff;
}

.file-viewer-unsupported {
  max-width: 440px;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.file-viewer-unsupported svg {
  width: 48px;
  height: 48px;
  color: var(--gold-dark);
}

.project-floating-actions {
  margin-top: 18px;
}

.project-members-field {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.project-members-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.project-member-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.project-member-choices label {
  display: flex;
  min-width: 0;
  min-height: 48px;
  padding: 7px 9px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.project-member-choices label:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.project-member-choices span,
.project-member-choices b,
.project-member-choices small {
  display: block;
  min-width: 0;
}

.project-member-choices small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.project-file-drop {
  display: grid;
  min-height: 180px;
  padding: 28px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed #aaa48f;
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
  text-align: center;
}

.project-file-drop > svg {
  width: 42px;
  height: 42px;
  color: #8b6812;
}

.project-file-drop small {
  color: var(--muted);
}

.project-file-drop input {
  width: min(100%, 300px);
  margin-top: 10px;
}

body.dark .project-portfolio-metrics article,
body.dark .project-metric-grid article,
body.dark .project-card,
body.dark .project-task-card,
body.dark .project-file-item {
  background: var(--panel);
}

body.dark .project-card-main:hover,
body.dark .project-member-choices label:has(input:checked) {
  background: rgba(226, 169, 36, 0.1);
}

@media (max-width: 1180px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
  }

  .project-portfolio-metrics,
  .project-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .project-detail-head {
    grid-template-columns: 40px 10px minmax(0, 1fr);
  }

  .project-detail-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .project-summary-grid {
    grid-template-columns: 1fr;
  }

  .project-kanban {
    grid-template-columns: repeat(4, minmax(270px, 82vw));
    scroll-snap-type: x mandatory;
  }

  .project-kanban-column {
    scroll-snap-align: start;
  }

  .onboarding-shell {
    width: min(100% - 24px, 720px);
    padding-top: 14px;
  }

  .onboarding-top {
    grid-template-columns: 120px minmax(160px, 1fr);
    gap: 14px;
  }

  .onboarding-top > img {
    width: 112px;
    height: 42px;
  }

  .onboarding-top > small {
    display: none;
  }

  .onboarding-card {
    min-height: calc(100vh - 84px);
    margin-top: 12px;
  }

  .onboarding-content {
    width: min(100% - 36px, 650px);
    padding: 34px 0 28px;
  }

  .business-profile-grid,
  .onboarding-import-grid,
  .settings-profile-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .business-profile-card {
    min-height: 190px;
  }

  .onboarding-payment-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .onboarding-account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .project-portfolio-metrics,
  .project-metric-grid,
  .project-grid,
  .project-files-grid,
  .project-member-choices {
    grid-template-columns: 1fr;
  }

  .project-portfolio-metrics article,
  .project-metric-grid article {
    min-height: 82px;
    padding: 14px;
  }

  .project-detail-head {
    gap: 9px;
  }

  .project-detail-head h2 {
    font-size: 20px;
  }

  .project-detail-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .project-detail-actions button {
    min-width: 0;
    padding: 0 8px;
    font-size: 11px;
  }

  .project-facts,
  .project-activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-floating-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-floating-actions button {
    min-width: 0;
    padding: 0 8px;
    font-size: 11px;
  }

  .project-kanban {
    margin-right: -16px;
    padding-right: 16px;
  }

  .project-file-item {
    grid-template-columns: 34px minmax(0, 1fr) repeat(3, 34px);
    gap: 7px;
  }

  .onboarding-shell {
    width: 100%;
    padding: 0;
  }

  .onboarding-top {
    position: sticky;
    z-index: 2;
    top: 0;
    min-height: 64px;
    padding: 7px 14px;
    border-radius: 0;
    background: #191b17;
  }

  .onboarding-top > img {
    width: 100px;
  }

  .onboarding-progress b {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .onboarding-progress span:last-child {
    flex-basis: 26px;
  }

  .onboarding-card {
    min-height: calc(100vh - 64px);
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .onboarding-content {
    width: calc(100% - 28px);
    padding: 26px 0 20px;
  }

  .onboarding-heading {
    margin-bottom: 24px;
  }

  .onboarding-heading h1 {
    font-size: 27px;
  }

  .onboarding-heading p {
    font-size: 14px;
  }

  .business-profile-grid,
  .onboarding-form-grid,
  .onboarding-import-grid,
  .onboarding-summary,
  .settings-profile-options,
  .settings-profile-actions {
    grid-template-columns: 1fr;
  }

  .business-profile-card {
    min-height: 0;
    padding: 16px 46px 16px 66px;
  }

  .business-profile-card > span {
    position: absolute;
    top: 16px;
    left: 14px;
    width: 40px;
    height: 40px;
    margin: 0;
  }

  .business-profile-card em {
    padding-top: 8px;
  }

  .onboarding-activity {
    margin-top: 20px;
  }

  .onboarding-account-grid section {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .onboarding-account-grid section > label {
    grid-column: 2;
  }

  .onboarding-account-grid section > span {
    align-self: start;
    grid-row: 1 / 3;
  }

  .onboarding-payment-methods {
    grid-template-columns: 1fr;
  }

  .onboarding-actions {
    position: sticky;
    bottom: 0;
    min-height: 70px;
    padding: 11px 14px;
    background: #fff;
  }

  .onboarding-error {
    width: calc(100% - 28px);
  }

  .onboarding-actions button {
    min-width: 0;
  }

  .onboarding-actions .primary {
    margin-left: auto;
  }

  .settings-business-profile {
    padding: 14px;
  }

  .settings-profile-actions button {
    width: 100%;
  }
}

.connection-status {
  min-height: 34px;
  margin-left: auto;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: #d5d7da;
  background: #fff;
  color: #41624b;
  font-size: 12px;
  font-weight: 750;
}

.connection-status svg {
  width: 15px;
  height: 15px;
}

.connection-status.offline {
  border-color: #edc8bd;
  background: #fff7f4;
  color: #a23c23;
}

.connection-status.pending {
  border-color: #e5c86d;
  background: #fffaf0;
  color: #73560c;
}

.pos-modebar {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pos-modebar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.pos-fullscreen-button {
  min-height: 38px;
  white-space: nowrap;
}

.pos-fullscreen-button svg {
  color: var(--brand);
}

.pos-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.pos-mode-switch.single {
  grid-template-columns: minmax(130px, 1fr);
}

.pos-mode-switch button {
  min-height: 42px;
  border: 0;
  border-radius: 0;
}

.pos-mode-switch button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--gold);
}

.pos-sync-state {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4f6d57;
  font-size: 12px;
  font-weight: 700;
}

.pos-sync-state.offline {
  color: #a23c23;
}

.pos-sync-state svg {
  width: 16px;
  height: 16px;
}

.pos-sync-state button {
  min-height: 32px;
  padding: 0 10px;
}

.restaurant-floor {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(24, 24, 24, 0.04);
}

.restaurant-floor .table-titlebar {
  padding: 0 0 14px;
}

.restaurant-floor .table-titlebar p,
.pos-cart .table-titlebar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.restaurant-tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.restaurant-table-wrap {
  position: relative;
  min-width: 0;
}

.restaurant-table {
  width: 100%;
  min-height: 104px;
  padding: 13px 42px 13px 13px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 7px 10px;
  align-items: center;
  text-align: left;
  background: #fafafa;
}

.restaurant-table.available {
  border-color: #d6ded8;
}

.restaurant-table.occupied {
  border-color: #e2c364;
  background: #fffaf0;
}

.restaurant-table.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand), inset 0 -4px 0 var(--gold);
}

.restaurant-table-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  grid-row: 1;
  border-radius: 50%;
  background: #ecefec;
  color: var(--brand);
}

.restaurant-table.occupied .restaurant-table-icon {
  background: #f8e8b8;
  color: #755800;
}

.restaurant-table-icon svg {
  width: 19px;
  height: 19px;
}

.restaurant-table strong,
.restaurant-table small {
  display: block;
}

.restaurant-table small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.restaurant-table-state {
  grid-column: 1 / -1;
  color: #55705e;
  font-size: 11px;
  font-weight: 800;
}

.restaurant-table.occupied .restaurant-table-state {
  color: #73560c;
}

.restaurant-table-edit {
  position: absolute;
  z-index: 1;
  top: 9px;
  right: 9px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
}

.restaurant-table-edit svg {
  width: 15px;
  height: 15px;
}

.restaurant-empty {
  min-height: 96px;
  grid-column: 1 / -1;
  justify-content: flex-start;
  text-align: left;
}

.restaurant-empty > span {
  display: grid;
  gap: 3px;
}

.restaurant-empty small {
  color: var(--muted);
}

.restaurant-order-actions {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
}

.restaurant-order-actions button {
  min-width: 0;
  padding: 0 8px;
  font-size: 11px;
}

.dashboard-role-heading {
  min-height: 34px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-role-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.dashboard-role-heading svg {
  width: 16px;
  height: 16px;
  color: var(--gold-dark);
}

.dashboard-role-heading small {
  font-size: 11px;
}

.dashboard-role-workspace {
  margin-top: 16px;
  overflow: hidden;
}

.dashboard-role-workspace .table-titlebar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-focus-list {
  display: grid;
}

.dashboard-focus-list > button {
  min-height: 50px;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.dashboard-focus-list > button:hover {
  background: var(--panel-2);
}

.dashboard-focus-list > button span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.dashboard-focus-list > button svg {
  color: var(--brand);
}

.dashboard-focus-list > button strong {
  overflow-wrap: anywhere;
}

.dashboard-focus-list > button em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-align: right;
}

.discovery-tour {
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
}

.discovery-tour::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(9, 10, 12, 0.64);
}

.discovery-card {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: min(430px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid rgba(226, 169, 36, 0.55);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
}

.discovery-progress {
  height: 4px;
  background: var(--panel-2);
}

.discovery-progress span {
  height: 100%;
  display: block;
  background: var(--gold);
  transition: width 180ms ease;
}

.discovery-card header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 10px;
}

.discovery-card header > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.discovery-card header small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.discovery-card h2 {
  margin: 2px 0 0;
  font-size: 19px;
}

.discovery-card > p {
  margin: 0;
  padding: 4px 18px 18px;
  color: var(--muted);
  line-height: 1.55;
}

.discovery-card footer {
  min-height: 60px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.discovery-card footer > div {
  display: flex;
  gap: 8px;
}

.tour-never {
  padding: 0 8px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.discovery-highlight {
  position: relative !important;
  z-index: 102 !important;
  outline: 3px solid var(--gold) !important;
  outline-offset: 4px;
  box-shadow: 0 0 0 8px rgba(226, 169, 36, 0.16) !important;
}

body.pos-fullscreen {
  height: 100dvh;
  overflow: hidden;
}

body.pos-fullscreen .app-shell {
  height: 100dvh;
  display: block;
}

body.pos-fullscreen .sidebar,
body.pos-fullscreen .topbar {
  display: none;
}

body.pos-fullscreen .main {
  width: 100%;
  height: 100dvh;
  overflow: auto;
  padding: 14px;
}

body.pos-fullscreen #view-sales {
  min-height: calc(100dvh - 28px);
}

body.pos-fullscreen .pos-modebar {
  position: sticky;
  z-index: 7;
  top: -14px;
  margin: -14px -14px 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

body.pos-fullscreen .pos-layout {
  align-items: start;
}

body.dark .discovery-card {
  background: var(--panel);
}

body.dark .pos-quick-launch {
  background: rgba(226, 169, 36, 0.08);
}

.developer-api-head {
  min-height: 92px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fff;
}

.developer-api-head h2 {
  margin: 4px 0 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.developer-api-head > code {
  max-width: 100%;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 6px;
  background: #202225;
  color: #f5df9c;
  white-space: nowrap;
}

.scope-chip {
  margin: 2px 3px 2px 0;
  padding: 3px 6px;
  display: inline-block;
  border: 1px solid #d9d9d6;
  border-radius: 4px;
  background: #f7f7f5;
  color: #484945;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.api-scope-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.dark .developer-api-head {
  background: #202225;
}

body.dark .connection-status,
body.dark .pos-mode-switch,
body.dark .restaurant-floor,
body.dark .restaurant-table {
  background: #202225;
}

body.dark .restaurant-table.occupied {
  background: #332d1d;
}

@media (max-width: 900px) {
  .connection-status {
    margin-left: 0;
  }

  .restaurant-tables {
    display: flex;
    margin-right: -16px;
    padding-right: 16px;
    overflow-x: auto;
  }

  .restaurant-table-wrap {
    flex: 0 0 190px;
  }

  .experience-switcher {
    width: 100%;
  }

  .pos-quick-launch {
    display: none;
  }

  body.pos-fullscreen .main {
    padding: 10px;
  }
}

@media (max-width: 640px) {
  .connection-status span {
    display: none;
  }

  .connection-status {
    width: 36px;
    min-height: 36px;
    padding: 0;
  }

  .pos-modebar {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-modebar-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .pos-fullscreen-button {
    width: 100%;
  }

  .pos-mode-switch {
    width: 100%;
  }

  .pos-sync-state {
    min-height: 32px;
  }

  .restaurant-floor {
    margin-right: -16px;
    margin-left: -16px;
    padding: 14px 16px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .restaurant-order-actions {
    grid-template-columns: 1fr 1fr;
  }

  .restaurant-order-actions .danger-text {
    grid-column: 1 / -1;
  }

  .developer-api-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-role-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-focus-list > button {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-focus-list > button em {
    padding-left: 25px;
    text-align: left;
  }

  .discovery-card {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .discovery-card footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .discovery-card footer > div,
  .discovery-card footer button {
    width: 100%;
  }

  .api-scope-grid {
    grid-template-columns: 1fr;
  }
}

.pdf-render-stage {
  position: fixed;
  top: 0;
  left: -100000px;
  z-index: -1000;
  background: #fff;
  pointer-events: none;
}

.pdf-render-stage .document-preview {
  max-width: none;
  margin: 0;
  box-shadow: none;
}

.pdf-render-stage .doc-head {
  align-items: flex-start;
  flex-direction: row;
}

.pdf-render-stage .doc-brand {
  align-items: flex-start;
  flex-direction: row;
  text-align: left;
}

.pdf-render-stage .doc-title {
  text-align: right;
}

.pdf-render-stage .document-preview.logo-center .doc-head,
.pdf-render-stage .document-preview.logo-center .doc-brand {
  align-items: center;
  flex-direction: column;
}

.pdf-render-stage .document-preview.logo-center .doc-title {
  text-align: center;
}

.pdf-render-stage .document-preview.logo-right .doc-head,
.pdf-render-stage .document-preview.logo-right .doc-brand {
  flex-direction: row-reverse;
}

.pdf-render-stage .document-preview.logo-right .doc-brand {
  text-align: right;
}

.pdf-render-stage .document-preview.logo-right .doc-title {
  text-align: left;
}

.pdf-render-stage .doc-logo {
  max-width: none;
  max-height: none;
}

.pdf-render-stage .doc-items-table {
  display: table;
}

.pdf-render-stage .doc-items-table thead {
  position: static;
  display: table-header-group;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.pdf-render-stage .doc-items-table tbody {
  display: table-row-group;
}

.pdf-render-stage .doc-items-table tbody tr {
  display: table-row;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.pdf-render-stage .doc-items-table tbody td,
.pdf-render-stage .doc-items-table tbody td:first-child {
  display: table-cell;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-weight: inherit;
  text-align: left;
}

.pdf-render-stage .doc-items-table tbody td.amount {
  text-align: right;
}

.pdf-render-stage .doc-items-table tbody td::before {
  display: none;
  content: none;
}

.pdf-render-stage .document-preview.layout-compact .doc-items-table th,
.pdf-render-stage .document-preview.layout-compact .doc-items-table td {
  padding: 8px 10px;
}

.pdf-render-stage .document-preview.layout-spacious .doc-items-table th,
.pdf-render-stage .document-preview.layout-spacious .doc-items-table td {
  padding: 15px 16px;
}

@media print {
  html,
  body {
    height: auto;
    overflow: visible;
  }

  body * {
    visibility: hidden;
  }

  #documentPreview,
  #documentPreview * {
    visibility: visible;
  }

  #documentPreview {
    position: fixed;
    inset: 0;
    border: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
}

/* POS work surface */
.pos-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(390px, 0.75fr);
  gap: 12px;
}

.pos-layout > div:first-child {
  min-height: 630px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f7f5;
}

.pos-catalog-toolbar {
  margin-bottom: 12px;
  align-items: center;
}

.pos-catalog-toolbar > div:first-child {
  min-width: 0;
}

.pos-catalog-toolbar h2 {
  margin: 0;
  font-size: 17px;
}

.pos-catalog-toolbar > div:first-child > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.pos-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pos-search {
  width: min(310px, 32vw);
  min-width: 190px;
  min-height: 40px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.pos-search:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 169, 36, 0.14);
}

.pos-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--muted);
}

.pos-search input {
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.pos-search input:focus {
  box-shadow: none;
}

.pos-held-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pos-held-button strong {
  min-width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 11px;
}

.pos-products {
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
}

.pos-product {
  min-height: 176px;
  gap: 0;
  border-radius: 6px;
  box-shadow: 0 2px 7px rgba(24, 24, 24, 0.07);
}

.pos-product:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(24, 24, 24, 0.11);
}

.pos-product:active:not(:disabled) {
  transform: translateY(0);
}

.pos-product-media {
  position: relative;
  height: 108px;
  aspect-ratio: auto;
  border-radius: 6px 6px 0 0;
  background: #e9e8e3;
}

.pos-product-media svg {
  width: 30px;
  height: 30px;
  color: #6f6d64;
}

.pos-product-price {
  position: absolute;
  right: 5px;
  bottom: 5px;
  max-width: calc(100% - 10px);
  padding: 4px 6px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(24, 24, 24, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-copy {
  padding: 9px 10px 10px;
  gap: 3px;
}

.pos-product-copy strong {
  min-height: 34px;
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pos-product-copy small:last-child {
  font-size: 10px;
}

.pos-product-copy .stock-empty {
  color: #a23c23;
}

.pos-products.view-list .pos-product {
  min-height: 66px;
  grid-template-columns: 66px minmax(0, 1fr);
}

.pos-products.view-list .pos-product-copy {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 10px;
}

.pos-products.view-list .pos-product-copy strong {
  min-height: auto;
}

.pos-products.view-list .pos-product-price {
  display: none;
}

.pos-products.view-list .pos-product-list-price {
  display: block;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.pos-products.view-list .pos-product-copy .pos-category,
.pos-products.view-list .pos-product-copy small:last-child {
  grid-column: 1;
}

.pos-cart {
  top: 12px;
  display: flex;
  height: clamp(520px, calc(100dvh - 182px), 760px);
  max-height: calc(100dvh - 24px);
  min-height: 520px;
  flex-direction: column;
  overflow: hidden;
  border-radius: 7px;
}

.pos-ticket-head {
  flex: 0 0 auto;
  padding: 14px 14px 11px;
}

.pos-ticket-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pos-ticket-customer {
  min-height: 50px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.pos-ticket-customer > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.pos-ticket-customer select {
  min-width: 0;
  min-height: 36px;
  padding: 0 28px 0 8px;
  border-color: transparent;
  background-color: transparent;
  font-weight: 700;
}

.pos-ticket-customer select:focus {
  border-color: var(--gold);
  background-color: #fff;
}

.pos-guest-field {
  padding: 8px 14px;
  grid-template-columns: 1fr 90px;
  align-items: center;
}

.pos-guest-field input {
  min-height: 36px;
}

.pos-cart .cart-lines {
  min-height: 170px;
  max-height: none;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pos-cart .cart-lines > .empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.pos-cart .cart-line {
  grid-template-columns: minmax(0, 1fr) auto auto 34px;
  padding: 11px 12px;
}

.pos-cart .cart-line > strong {
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.pos-summary {
  flex: 0 0 auto;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.pos-summary .grand {
  font-size: 22px;
}

.pos-ticket-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
  border-top: 1px solid var(--line);
}

.pos-ticket-actions > button {
  min-height: 62px;
  border: 0;
  border-radius: 0;
}

.pos-ticket-actions > button:first-child {
  border-right: 1px solid var(--line);
}

.pos-ticket-actions .pos-pay {
  width: 100%;
  margin: 0;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pos-ticket-actions .pos-pay strong {
  font-size: 16px;
  white-space: nowrap;
}

.pos-register-state {
  min-height: 33px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--line);
  color: #9b3d28;
  font-size: 10px;
  font-weight: 750;
}

.pos-register-state.open {
  color: #3f6a4a;
}

.pos-register-state svg {
  width: 13px;
  height: 13px;
}

.pos-register-state button {
  min-height: 26px;
  margin-left: auto;
  padding: 0 8px;
  font-size: 10px;
}

.pos-checkout-modal {
  width: min(720px, calc(100vw - 24px));
}

.pos-checkout-modal .modal-inner {
  max-height: min(880px, calc(100dvh - 24px));
  overflow-y: auto;
}

.modal-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.pos-checkout-total {
  padding: 22px 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f5;
}

.pos-checkout-total span {
  color: var(--muted);
  font-weight: 700;
}

.pos-checkout-total strong {
  color: var(--brand);
  font-size: 34px;
  line-height: 1;
}

.pos-checkout-section {
  padding: 18px 24px 0;
}

.pos-checkout-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.pos-checkout-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pos-payment-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.pos-payment-choices button {
  min-height: 64px;
  padding: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  font-size: 11px;
}

.pos-payment-choices button svg {
  width: 22px;
  height: 22px;
}

.pos-payment-choices button.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--brand);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.pos-quick-cash {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}

.pos-quick-cash button {
  min-height: 30px;
  padding: 0 9px;
  flex: 0 0 auto;
  font-size: 10px;
}

.pos-tender-input {
  margin-top: 8px;
}

.pos-tender-input input {
  min-height: 54px;
  font-size: 22px;
  font-weight: 800;
  text-align: right;
}

.pos-checkout-details {
  margin: 18px 24px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.pos-checkout-details summary {
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.pos-checkout-details summary::-webkit-details-marker {
  display: none;
}

.pos-checkout-details summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pos-checkout-details summary svg {
  width: 16px;
  height: 16px;
}

.pos-checkout-details[open] summary > svg {
  transform: rotate(180deg);
}

.pos-checkout-details .grid {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.pos-checkout-hint {
  min-height: 18px;
  margin: 12px 24px 0;
}

.pos-checkout-result {
  margin: 12px 24px 0;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.pos-checkout-result > div {
  display: grid;
  gap: 3px;
}

.pos-checkout-result .change {
  text-align: right;
}

.pos-checkout-result span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.pos-checkout-result strong {
  font-size: 20px;
}

.pos-checkout-result .change strong {
  color: #356543;
}

.pos-checkout-actions {
  padding: 16px 24px 22px;
}

.pos-checkout-actions button {
  min-height: 48px;
}

.pos-held-ticket-list {
  min-height: 180px;
  max-height: 60dvh;
  overflow-y: auto;
}

.pos-held-ticket {
  min-height: 72px;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.pos-held-ticket-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.pos-held-ticket-icon svg {
  width: 17px;
  height: 17px;
}

.pos-held-ticket small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.pos-held-empty {
  min-height: 220px;
  padding: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.pos-held-empty svg {
  width: 30px;
  height: 30px;
}

.pos-success-modal {
  width: min(480px, calc(100vw - 24px));
  text-align: center;
}

.pos-success-modal .modal-inner {
  padding: 34px;
}

.pos-success-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7f2e8;
  color: #356543;
}

.pos-success-mark svg {
  width: 34px;
  height: 34px;
}

.pos-success-modal > .modal-inner > span {
  color: var(--muted);
  font-weight: 750;
}

.pos-success-modal h2 {
  margin: 8px 0 22px;
  font-size: 38px;
}

.pos-success-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pos-success-values div {
  padding: 14px;
  display: grid;
  gap: 5px;
}

.pos-success-values div + div {
  border-left: 1px solid var(--line);
}

.pos-success-values span {
  color: var(--muted);
  font-size: 11px;
}

.pos-success-actions {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pos-success-actions button {
  min-height: 48px;
}

body.pos-fullscreen .pos-cart {
  max-height: calc(100dvh - 82px);
  min-height: calc(100dvh - 82px);
}

body.pos-fullscreen .pos-layout > div:first-child {
  min-height: calc(100dvh - 82px);
}

body.pos-fullscreen .pos-products {
  max-height: calc(100dvh - 215px);
  overflow-y: auto;
}

body.dark .pos-layout > div:first-child,
body.dark .pos-ticket-customer,
body.dark .pos-summary,
body.dark .pos-checkout-total {
  background: var(--panel-2);
}

body.dark .pos-search,
body.dark .pos-product {
  background: var(--panel);
}

@media (max-width: 1100px) {
  .pos-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(350px, 0.75fr);
  }

  .pos-products {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .pos-search {
    width: 190px;
  }

  .pos-scan-button span {
    display: none;
  }
}

@media (max-width: 900px) {
  #view-sales {
    padding-bottom: 78px;
  }

  .pos-layout {
    grid-template-columns: 1fr;
  }

  .pos-layout > div:first-child,
  .pos-cart {
    min-height: auto;
    max-height: none;
  }

  .pos-mobile-switch {
    position: fixed;
    z-index: 12;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  }

  .pos-mobile-switch button {
    min-width: 0;
    min-height: 46px;
    padding: 0 8px;
    border: 0;
    background: transparent;
  }

  .pos-mobile-switch button.active {
    background: var(--gold);
    color: #17140c;
  }

  .pos-layout.mobile-catalog .pos-cart {
    display: none;
  }

  .pos-layout.mobile-cart > div:first-child {
    display: none;
  }

  .pos-layout.mobile-cart .pos-cart {
    display: flex;
  }

  .pos-cart .cart-lines {
    min-height: 250px;
  }

  .pos-modebar-actions {
    gap: 7px;
  }
}

@media (max-width: 640px) {
  .pos-layout > div:first-child {
    margin-right: -16px;
    margin-left: -16px;
    padding: 10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .pos-modebar-actions {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-sync-state {
    grid-column: 1 / -1;
  }

  .pos-held-button,
  .pos-fullscreen-button {
    min-width: 0;
    width: 100%;
    overflow: hidden;
  }

  .pos-held-button span,
  .pos-fullscreen-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pos-catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .pos-search {
    width: 100%;
    min-width: 0;
  }

  .pos-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-category-filters {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .pos-product {
    min-height: 164px;
  }

  .pos-product-media {
    height: 96px;
  }

  .pos-cart {
    margin-right: -16px;
    margin-left: -16px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .pos-cart .cart-line {
    grid-template-columns: minmax(0, 1fr) auto 32px;
    grid-template-areas:
      "item amount remove"
      "item quantity remove";
    gap: 6px;
    padding: 10px 8px;
  }

  .pos-cart .cart-line > div:first-child {
    grid-area: item;
  }

  .pos-cart .cart-line .quantity-stepper {
    grid-area: quantity;
  }

  .pos-cart .cart-line > strong {
    grid-area: amount;
    grid-column: auto;
    font-size: 11px;
  }

  .pos-cart .cart-line > .danger-icon {
    grid-area: remove;
  }

  .quantity-stepper {
    grid-template-columns: 26px 24px 26px;
  }

  .quantity-stepper button {
    width: 26px;
  }

  .pos-checkout-modal {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .pos-checkout-modal .modal-inner {
    min-height: 100dvh;
    max-height: 100dvh;
  }

  .pos-checkout-total,
  .pos-checkout-section {
    padding-right: 16px;
    padding-left: 16px;
  }

  .pos-checkout-total strong {
    font-size: 27px;
  }

  .pos-checkout-details,
  .pos-checkout-result,
  .pos-checkout-hint {
    margin-right: 16px;
    margin-left: 16px;
  }

  .pos-payment-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pos-checkout-details .grid {
    grid-template-columns: 1fr;
  }

  .pos-checkout-actions {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--panel);
  }

  .pos-held-ticket {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .pos-held-ticket > strong {
    grid-column: 2;
  }

  .pos-held-ticket .row-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .pos-success-modal .modal-inner {
    padding: 28px 18px;
  }

  .pos-success-actions {
    grid-template-columns: 1fr;
  }

  body.pos-fullscreen .pos-layout > div:first-child,
  body.pos-fullscreen .pos-cart {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  body.pos-fullscreen .pos-cart {
    height: calc(100dvh - 238px);
    min-height: 420px;
    max-height: calc(100dvh - 238px);
  }

  body.pos-fullscreen .pos-cart .cart-lines {
    min-height: 0;
  }
}

/* Final POS sizing overrides stay after the legacy responsive rules. */
#view-sales .pos-cart {
  height: clamp(580px, calc(100dvh - 232px), 790px);
}

#view-sales .pos-ticket-actions > button {
  min-height: 72px;
}

#view-sales .restaurant-order-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pos-success-modal .pos-success-actions {
  grid-template-columns: repeat(3, 1fr);
}

body.pos-fullscreen #view-sales .pos-catalog-surface,
body.pos-fullscreen #view-sales .pos-cart {
  height: calc(100dvh - 150px);
  min-height: calc(100dvh - 150px);
  max-height: calc(100dvh - 150px);
}

body.pos-fullscreen #view-sales .pos-recent-sales {
  display: none;
}

@media (max-width: 900px) {
  #view-sales .pos-cart {
    height: auto;
  }
}

@media (max-width: 640px) {
  #view-sales .pos-toolbar-actions {
    grid-template-columns: 48px minmax(96px, 1fr) 48px;
  }

  #view-sales .pos-toolbar-actions .pos-search {
    grid-column: 1 / -1;
  }

  #view-sales .pos-catalog-surface {
    padding-bottom: 66px;
  }

  #view-sales .pos-catalog-surface .pos-category-filters {
    position: fixed;
    z-index: 11;
    right: 10px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 10px;
    min-height: 58px;
    margin: 0;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
  }

  #view-sales .pos-catalog-surface .pos-category-filters button {
    min-width: 92px;
    min-height: 46px;
  }

  #view-sales .pos-layout.mobile-cart .pos-category-filters {
    display: none;
  }

  .pos-success-modal .pos-success-actions {
    grid-template-columns: 1fr;
  }

  .pos-keyboard-modal .modal-inner {
    padding: 9px;
  }

  .pos-keyboard-modal .modal-head {
    min-height: 48px;
  }

  .pos-keyboard-display {
    min-height: 50px;
    margin-bottom: 7px;
    font-size: 20px;
  }

  .pos-keyboard-keys {
    gap: 4px;
  }

  .pos-keyboard-keys > div {
    gap: 3px;
  }

  .pos-keyboard-keys button {
    width: auto;
    min-width: 0;
    min-height: 43px;
    padding: 2px;
    flex: 1 1 0;
    font-size: 12px;
  }

  .pos-keyboard-keys .space {
    width: auto;
    flex: 3 1 0;
  }
}

/* Restaurant order flow */
#view-sales .pos-order-launchbar {
  min-height: 78px;
  margin-bottom: 12px;
  padding: 8px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.pos-primary-order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 260px));
  gap: 8px;
}

.pos-primary-order-actions > button {
  min-height: 60px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.pos-primary-order-actions > button.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #18150d;
}

.pos-primary-order-actions > button svg {
  width: 25px;
  height: 25px;
}

.pos-primary-order-actions > button strong {
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #24231f;
  color: #fff;
  font-size: 12px;
}

#view-sales .pos-products {
  align-content: start;
  grid-auto-rows: 196px;
}

#view-sales .pos-products.view-grid .pos-product {
  height: 196px;
  min-height: 196px;
}

#view-sales .pos-products.view-list {
  grid-auto-rows: 70px;
}

#view-sales .pos-products.view-list .pos-product {
  height: 70px;
  min-height: 70px;
}

#view-sales .pos-ticket-order-number {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-dark);
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

#view-sales .pos-ticket-head h2 {
  margin: 5px 0 0;
  font-size: 17px;
}

#view-sales .pos-ticket-head p {
  margin: 3px 0 0;
}

#view-sales .restaurant-order-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#view-sales .pos-balance {
  margin: 6px -4px -5px;
  padding: 8px 4px 2px;
  border-top: 1px solid var(--line);
  color: #8a4f00;
}

.pos-new-order-modal {
  width: min(850px, calc(100vw - 24px));
}

.pos-new-order-modal .modal-inner {
  padding: 22px;
}

.pos-new-order-content {
  min-height: 330px;
  padding: 16px 0;
}

.pos-new-order-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pos-new-order-types button {
  min-height: 210px;
  padding: 22px 12px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: #fafaf8;
  color: var(--ink);
}

.pos-new-order-types button:hover,
.pos-new-order-types button:focus-visible {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.pos-new-order-types button svg {
  width: 54px;
  height: 54px;
  color: var(--gold-dark);
}

.pos-new-order-types button strong {
  font-size: 19px;
}

.pos-new-order-types button small {
  color: var(--muted);
}

.pos-new-order-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.pos-new-order-table-grid button {
  min-height: 108px;
  padding: 10px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fafaf8;
}

.pos-new-order-table-grid button.active {
  border: 2px solid var(--gold-dark);
  background: var(--gold);
  color: #18150d;
}

.pos-new-order-table-grid button:disabled {
  background: #eeeeea;
  color: #898983;
}

.pos-new-order-table-grid button svg {
  width: 30px;
  height: 30px;
}

.pos-new-order-table-grid button small {
  font-size: 10px;
}

.pos-new-order-divider {
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.pos-new-order-name {
  max-width: 620px;
  margin: 0 auto;
}

.pos-new-order-name input,
.pos-new-order-name .icon-button {
  min-height: 62px;
}

.pos-new-order-name input {
  font-size: 20px;
  font-weight: 800;
}

.pos-new-order-name .icon-button {
  width: 62px;
}

.pos-open-order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 9px;
}

.pos-open-order-card {
  position: relative;
  min-height: 132px;
  padding: 42px 16px 14px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafaf8;
  text-align: left;
}

.pos-open-order-number {
  position: absolute;
  top: 12px;
  left: 16px;
  color: var(--gold-dark);
  font-size: 21px;
  font-weight: 950;
}

.pos-open-order-card > .badge {
  position: absolute;
  bottom: 9px;
  left: 64px;
}

.pos-open-order-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.pos-split-mode,
.pos-checkout-order-actions,
.pos-checkout-payment-mode {
  padding: 12px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.pos-split-mode {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pos-split-mode button,
.pos-checkout-order-actions button,
.pos-checkout-payment-mode button {
  min-height: 72px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fafaf8;
}

.pos-split-mode button.active,
.pos-checkout-order-actions button.active,
.pos-checkout-payment-mode button.active {
  border: 2px solid var(--gold-dark);
  background: var(--gold-soft);
  color: var(--ink);
}

.pos-split-mode button span,
.pos-checkout-order-actions button span {
  display: grid;
  gap: 3px;
  text-align: left;
}

.pos-split-mode button small,
.pos-checkout-order-actions button small {
  color: var(--muted);
  font-size: 10px;
}

.pos-split-amount-panel {
  padding: 18px 20px;
}

.pos-split-custom-panel {
  padding: 18px 20px;
}

.pos-split-custom-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.pos-split-custom-quick button {
  min-height: 70px;
  display: grid;
  place-items: center;
  gap: 3px;
}

.pos-split-custom-quick button strong {
  font-size: 19px;
}

.pos-split-custom-quick button span,
.pos-split-custom-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.pos-split-custom-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 10px;
}

.pos-split-custom-grid > label,
.pos-split-custom-grid > div {
  min-height: 94px;
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafaf8;
}

.pos-split-custom-grid input,
.pos-split-custom-grid strong {
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 27px;
  font-weight: 900;
}

.pos-orders-new-order {
  width: 100%;
  min-height: 92px;
  margin-bottom: 14px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 14px;
  border: 2px solid var(--gold-dark);
  background: var(--gold-soft);
  text-align: left;
}

.pos-orders-new-order > span {
  width: 54px;
  height: 54px;
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  border-radius: 7px;
  background: var(--gold);
  color: #17140c;
}

.pos-orders-new-order > strong {
  align-self: end;
  font-size: 19px;
}

.pos-orders-new-order > small {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
}


.pos-split-amount-panel input {
  min-height: 62px;
  font-size: 25px;
  font-weight: 900;
}

.pos-split-amount-quick {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.pos-split-amount-quick button {
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 3px;
}

.pos-split-amount-quick span {
  color: var(--muted);
  font-size: 11px;
}

.pos-mixed-payment-rows {
  display: grid;
  gap: 8px;
}

.pos-mixed-payment-row {
  padding: 9px;
  display: grid;
  grid-template-columns: 34px minmax(120px, 1fr) minmax(150px, 1.3fr) minmax(110px, 0.7fr) 42px;
  align-items: end;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafaf8;
}

.pos-mixed-payment-index {
  width: 32px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #24231f;
  color: #fff;
  font-weight: 900;
}

.pos-mixed-payment-row label > span {
  margin-bottom: 4px;
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.pos-mixed-payment-balance {
  margin-top: 10px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font-size: 17px;
  font-weight: 850;
}

.pos-mixed-payment-balance .warning {
  color: var(--accent);
}

.pos-checkout-result {
  display: none;
}

@media (max-width: 900px) {
  #view-sales .pos-order-launchbar {
    align-items: stretch;
  }

  .pos-primary-order-actions {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  #view-sales .pos-order-launchbar .pos-modebar-actions {
    flex: 0 0 auto;
  }

  .pos-new-order-types {
    grid-template-columns: 1fr;
  }

  .pos-new-order-types button {
    min-height: 104px;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: start;
    text-align: left;
  }

  .pos-new-order-types button svg {
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
  }

  .pos-new-order-content {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  #view-sales .pos-order-launchbar {
    padding: 6px;
  }

  .pos-primary-order-actions > button {
    min-height: 58px;
    padding: 6px 9px;
    font-size: 12px;
  }

  #view-sales .pos-order-launchbar .pos-sync-state {
    display: none;
  }

  #view-sales .pos-order-launchbar .pos-fullscreen-button {
    width: 48px;
    min-width: 48px;
    padding: 0;
  }

  #view-sales .pos-order-launchbar .pos-fullscreen-button span {
    display: none;
  }

  .pos-new-order-modal,
  .pos-orders-modal,
  .pos-split-modal {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .pos-new-order-modal .modal-inner,
  .pos-orders-modal .modal-inner,
  .pos-split-modal .modal-inner {
    min-height: 100dvh;
    max-height: 100dvh;
    padding: 14px;
  }

  .pos-new-order-table-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-split-mode,
  .pos-checkout-order-actions,
  .pos-checkout-payment-mode {
    padding: 8px 12px;
  }

  .pos-split-mode {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pos-split-mode button {
    min-height: 84px;
    flex-direction: column;
    gap: 5px;
  }

  .pos-split-mode button span {
    text-align: center;
  }

  .pos-split-mode button small {
    display: none;
  }

  .pos-split-custom-panel {
    padding: 12px;
  }

  .pos-split-custom-grid {
    grid-template-columns: 1fr;
  }

  .pos-split-mode button,
  .pos-checkout-order-actions button,
  .pos-checkout-payment-mode button {
    min-height: 62px;
    padding: 7px;
    font-size: 11px;
  }

  .pos-split-amount-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-mixed-payment-row {
    grid-template-columns: 30px minmax(0, 1fr) 40px;
  }

  .pos-mixed-payment-row label {
    grid-column: 2;
  }

  .pos-mixed-payment-row .pos-mixed-payment-index {
    grid-row: 1 / span 3;
  }

  .pos-mixed-payment-row .icon-button {
    grid-column: 3;
    grid-row: 1 / span 3;
  }
}

/* Keep these POS overrides last: legacy responsive rules above must not resize them. */
#view-sales .pos-catalog-toolbar .pos-toolbar-actions {
  flex-wrap: nowrap;
}

#view-sales .pos-catalog-toolbar .icon-segmented {
  width: 106px;
  min-width: 106px;
  height: 50px;
  min-height: 50px;
  grid-template-columns: repeat(2, 52px);
}

#view-sales .pos-catalog-toolbar .icon-segmented button {
  width: 52px;
  min-width: 52px;
  height: 48px;
  min-height: 48px;
  padding: 0;
}

#view-sales .pos-catalog-surface .pos-category-filters {
  min-height: 72px;
  padding: 8px 12px;
  gap: 8px;
}

#view-sales .pos-catalog-surface .pos-category-filters button {
  width: auto;
  min-width: 142px;
  max-width: 210px;
  min-height: 54px;
  padding: 8px 16px;
  white-space: nowrap;
}

#view-sales .pos-catalog-surface .pos-category-filters button span:last-child {
  width: auto;
  height: auto;
  margin: 0;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-sales .restaurant-order-actions.single {
  grid-template-columns: 1fr;
}

#view-sales .restaurant-order-actions.single button {
  min-height: 54px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.pos-orders-modal {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.pos-orders-modal::backdrop {
  background: var(--panel);
}

.pos-orders-modal .modal-inner {
  width: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  padding: 22px 28px 18px;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border-radius: 0;
}

.pos-orders-modal .pos-orders-content {
  min-height: 0;
  max-height: none;
  padding: 18px 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.pos-orders-modal .modal-actions {
  position: static;
  margin: 0;
  padding: 14px 0 0;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.pos-open-order-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}

.pos-open-order-card {
  min-height: 146px;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto 20px;
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafaf8;
}

.pos-open-order-card > .pos-open-order-number {
  position: static;
  top: auto;
  left: auto;
  width: auto;
  height: auto;
  display: block;
  grid-column: 1 / 3;
  border-radius: 0;
  background: transparent;
  font-size: 23px;
  line-height: 1;
  white-space: nowrap;
}

.pos-open-order-card > .badge {
  position: static;
  width: auto;
  height: 26px;
  padding: 4px 9px;
  display: inline-flex;
  grid-column: 3 / 5;
  justify-self: end;
  border-radius: 999px;
  white-space: nowrap;
}

.pos-open-order-card > .pos-open-order-icon {
  width: 50px;
  height: 50px;
  grid-column: 1;
  grid-row: 2;
}

.pos-open-order-card > .pos-open-order-copy {
  width: auto;
  height: auto;
  display: block;
  min-width: 0;
  grid-column: 2;
  grid-row: 2;
  place-items: initial;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

.pos-open-order-copy strong,
.pos-open-order-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-open-order-copy strong {
  font-size: 17px;
}

.pos-open-order-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.pos-open-order-total {
  grid-column: 3;
  grid-row: 2;
  font-size: 18px;
  white-space: nowrap;
}

.pos-open-order-card > svg:last-child {
  grid-column: 4;
  grid-row: 2;
}

.pos-keyboard-modal[data-keyboard-mode="numeric"] .pos-keyboard-keys > div:nth-child(2),
.pos-keyboard-modal[data-keyboard-mode="numeric"] .pos-keyboard-keys > div:nth-child(3),
.pos-keyboard-modal[data-keyboard-mode="numeric"] .pos-keyboard-keys > div:nth-child(4) {
  display: none;
}

@media (max-width: 720px) {
  #view-sales .pos-catalog-toolbar .pos-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 106px 52px;
  }

  #view-sales .pos-catalog-toolbar .pos-search {
    grid-column: 1 / -1;
  }

  #view-sales .pos-catalog-surface .pos-category-filters button {
    min-width: 116px;
    max-width: 156px;
    padding: 7px 11px;
  }

  .pos-orders-modal .modal-inner {
    padding: 14px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .pos-open-order-grid {
    grid-template-columns: 1fr;
  }

  .pos-open-order-card {
    min-height: 132px;
    padding: 14px;
    grid-template-columns: 44px minmax(0, 1fr) auto 18px;
    gap: 9px;
  }

  .pos-open-order-card > .pos-open-order-number {
    font-size: 20px;
  }

  .pos-open-order-card > .pos-open-order-icon {
    width: 44px;
    height: 44px;
  }

  .pos-open-order-total {
    font-size: 15px;
  }
}

/* Final POS tactile overrides: keep after every generic modal rule. */
.modal.pos-orders-modal,
.modal.pos-checkout-modal,
.modal.pos-split-modal {
  position: fixed;
  inset: var(--pos-workspace-top, 0px) 0 0;
  width: 100vw;
  max-width: none;
  height: calc(100dvh - var(--pos-workspace-top, 0px));
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.modal.pos-orders-modal::backdrop,
.modal.pos-checkout-modal::backdrop,
.modal.pos-split-modal::backdrop {
  background: transparent;
}

.modal.pos-orders-modal .modal-inner,
.modal.pos-checkout-modal .modal-inner,
.modal.pos-split-modal .modal-inner {
  width: 100%;
  min-height: 100%;
  max-height: 100%;
  border-radius: 0;
}

.modal.pos-checkout-modal .modal-inner,
.modal.pos-split-modal .modal-inner {
  padding: 18px clamp(16px, 3vw, 42px);
  overflow-y: auto;
}

.modal.pos-checkout-modal .pos-checkout-total {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.modal.pos-checkout-modal .pos-checkout-actions,
.modal.pos-split-modal .modal-actions {
  position: sticky;
  z-index: 3;
  bottom: -18px;
  margin-top: auto;
  padding: 14px 0 18px;
  background: var(--panel);
}

.pos-checkout-modal .pos-mixed-payment-row {
  min-height: 76px;
  padding: 12px;
  grid-template-columns: 42px minmax(180px, 1fr) minmax(150px, 0.75fr) 52px;
  gap: 12px;
}

.pos-checkout-modal .pos-mixed-payment-row select,
.pos-checkout-modal .pos-mixed-payment-row input {
  min-height: 52px;
  font-size: 17px;
}

.pos-split-modal .pos-split-amount-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(420px, 1.3fr);
  align-items: end;
  gap: 18px;
}

.pos-split-modal .pos-split-amount-head > div:first-child {
  display: grid;
  gap: 5px;
}

.pos-split-modal .pos-split-amount-head > div:first-child strong {
  font-size: 18px;
}

.pos-split-modal .pos-split-amount-head > div:first-child span {
  color: var(--muted);
  font-size: 13px;
}

.pos-split-modal .pos-split-amount-quick {
  margin: 0;
  grid-template-columns: repeat(5, minmax(88px, 1fr));
}

.pos-split-modal .pos-split-amount-quick button {
  min-height: 58px;
  font-size: 14px;
  font-weight: 850;
}

.pos-split-modal .pos-split-amount-quick button.active {
  border: 2px solid var(--gold-dark);
  background: var(--gold-soft);
}

.pos-split-modal .pos-split-amount-rows {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.pos-split-modal .pos-split-amount-row {
  min-height: 76px;
  padding: 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.pos-split-modal .pos-split-amount-row.active {
  border: 2px solid var(--gold-dark);
  background: var(--gold-soft);
}

.pos-split-modal .pos-split-amount-copy {
  display: grid;
  gap: 4px;
}

.pos-split-modal .pos-split-amount-copy strong {
  font-size: 17px;
}

.pos-split-modal .pos-split-amount-copy small {
  color: var(--muted);
  font-size: 12px;
}

.pos-split-modal .pos-split-amount-value {
  font-size: 20px;
  white-space: nowrap;
}

.modal.pos-keyboard-modal {
  position: fixed;
  inset: auto 0 0;
  width: 100vw;
  max-width: none;
  max-height: min(68dvh, 610px);
  margin: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -16px 44px rgba(0, 0, 0, 0.18);
}

.modal.pos-keyboard-modal::backdrop {
  background: transparent;
}

.modal.pos-keyboard-modal .modal-inner {
  width: 100%;
  max-height: min(68dvh, 610px);
  padding: 10px clamp(10px, 2vw, 28px) calc(12px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 8px 8px 0 0;
}

.modal.pos-keyboard-modal .modal-head {
  min-height: 42px;
  padding-bottom: 6px;
}

.modal.pos-keyboard-modal .pos-keyboard-display {
  min-height: 54px;
  margin-bottom: 8px;
  padding: 8px 14px;
  font-size: 24px;
}

.modal.pos-keyboard-modal .pos-keyboard-keys {
  gap: 6px;
}

.modal.pos-keyboard-modal .pos-keyboard-keys > div {
  width: 100%;
  gap: 6px;
}

.modal.pos-keyboard-modal .pos-keyboard-keys button {
  width: auto;
  min-width: 0;
  min-height: 54px;
  padding: 4px;
  flex: 1 1 0;
  font-size: 17px;
}

.modal.pos-keyboard-modal .pos-keyboard-keys .space {
  width: auto;
  flex: 4 1 0;
}

#restaurantTableForm .restaurant-table-delete {
  margin-right: auto;
}

@media (max-width: 720px) {
  .modal.pos-checkout-modal .modal-inner,
  .modal.pos-split-modal .modal-inner {
    padding: 12px;
  }

  .modal.pos-checkout-modal .pos-checkout-actions,
  .modal.pos-split-modal .modal-actions {
    bottom: -12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .pos-checkout-modal .pos-mixed-payment-row {
    grid-template-columns: 38px minmax(0, 1fr) 48px;
  }

  .pos-checkout-modal .pos-mixed-payment-row label {
    grid-column: 2;
  }

  .pos-checkout-modal .pos-mixed-payment-row .pos-mixed-payment-index {
    grid-row: 1 / span 2;
  }

  .pos-checkout-modal .pos-mixed-payment-row .icon-button {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .pos-split-modal .pos-split-amount-head {
    grid-template-columns: 1fr;
  }

  .pos-split-modal .pos-split-amount-quick {
    display: flex;
    overflow-x: auto;
  }

  .pos-split-modal .pos-split-amount-quick button {
    min-width: 104px;
  }

  .pos-split-modal .pos-split-amount-rows {
    grid-template-columns: 1fr;
  }

  .pos-split-modal .pos-split-amount-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .modal.pos-keyboard-modal,
  .modal.pos-keyboard-modal .modal-inner {
    max-height: 62dvh;
  }

  .modal.pos-keyboard-modal .modal-inner {
    padding: 7px 7px calc(9px + env(safe-area-inset-bottom));
  }

  .modal.pos-keyboard-modal .modal-head {
    min-height: 36px;
  }

  .modal.pos-keyboard-modal .pos-keyboard-display {
    min-height: 46px;
    font-size: 19px;
  }

  .modal.pos-keyboard-modal .pos-keyboard-keys,
  .modal.pos-keyboard-modal .pos-keyboard-keys > div {
    gap: 3px;
  }

  .modal.pos-keyboard-modal .pos-keyboard-keys button {
    min-height: 43px;
    font-size: 13px;
  }
}

/* Final verified POS rules. Keep this block at the physical end of the file. */
#view-sales .pos-loyverse-shell .pos-layout {
  min-height: 520px;
}

#view-sales .pos-loyverse-shell .pos-layout > .pos-catalog-surface,
#view-sales .pos-loyverse-shell .pos-cart {
  height: clamp(520px, calc(100dvh - 205px), 850px);
  min-height: 520px;
  max-height: 850px;
}

#view-sales .pos-loyverse-shell .pos-catalog-toolbar > div:first-child {
  min-width: 142px;
  flex: 0 0 142px;
}

#view-sales .pos-loyverse-shell .pos-catalog-toolbar h2 {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-sales .pos-loyverse-shell .pos-search {
  width: 220px;
  min-width: 160px;
}

.modal.pos-checkout-modal .pos-checkout-pane {
  padding-bottom: 96px;
}

.modal.pos-checkout-modal .pos-checkout-actions {
  position: fixed;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 31%;
  margin: 0;
  padding: 14px 20px;
  border-top: 1px solid #44474d;
  background: #2b2d31;
}

body.pos-fullscreen #view-sales .pos-loyverse-shell .pos-layout > .pos-catalog-surface,
body.pos-fullscreen #view-sales .pos-loyverse-shell .pos-cart {
  height: calc(100dvh - 68px);
  min-height: calc(100dvh - 68px);
  max-height: calc(100dvh - 68px);
}

@media (max-width: 1600px) {
  #view-sales .pos-loyverse-shell .pos-catalog-toolbar .icon-segmented {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 52px;
  }
}

@media (max-width: 900px) {
  #view-sales .pos-loyverse-shell .pos-layout.mobile-catalog > .pos-catalog-surface {
    display: grid;
  }

  #view-sales .pos-loyverse-shell .pos-layout.mobile-catalog > .pos-cart {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-layout.mobile-cart > .pos-catalog-surface {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-layout.mobile-cart > .pos-cart {
    display: flex;
  }

  .modal.pos-checkout-modal .pos-checkout-actions {
    left: 0;
  }
}

@media (max-width: 640px) {
  #view-sales .pos-loyverse-shell .pos-catalog-toolbar > div:first-child {
    display: none;
  }

  #view-sales .pos-loyverse-shell .pos-toolbar-actions {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  #view-sales .pos-loyverse-shell .pos-layout > .pos-catalog-surface,
  #view-sales .pos-loyverse-shell .pos-cart {
    height: calc(100dvh - 230px);
    min-height: 480px;
    max-height: none;
  }
}
