/* ======================================================================== */
/* pos-v2 — brutalist monochrome (modeled on yeezy.com)                      */
/* ======================================================================== */
/*
 * Design intent
 * ──────────────
 * Pure black on pure white.  No color.  No radii.  No shadows.  No gradients.
 * Helvetica.  All-caps section labels.  Thin 1px black borders as the only
 * structural element.  Typography does every piece of heavy lifting.
 *
 * The POS shouldn't try to look friendly — it should look decisive.  A
 * cashier scans two numbers and presses Enter; the UI gets out of the way.
 *
 * Every class name stays pos-v2-native.  Only the visual tokens change.
 */

/* =======================  TOKENS  ======================================== */

:root {
  --bg:          #ffffff;
  --bg-sunken:   #f0f0f0;
  --surface:     #ffffff;
  --surface-2:   #fafafa;

  --ink:         #000000;
  --ink-soft:    #000000;
  --ink-muted:   #666666;
  --ink-faint:   #999999;
  --ink-subtle:  #cccccc;

  --line:        #000000;
  --line-soft:   #cccccc;

  --accent:      #000000;
  --accent-ink:  #ffffff;

  --primary:       #000000;
  --primary-hover: #1a1a1a;
  --primary-ink:   #ffffff;

  --ok:      #000000;
  --ok-soft: #f0f0f0;
  --warn:    #000000;
  --warn-soft:  #f0f0f0;
  --danger:     #d00000;
  --danger-soft:#ffeeee;

  --ring:      0 0 0 2px #000000;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-card: none;

  --radius:    0;
  --radius-sm: 0;
  --radius-lg: 0;

  /* Inter — loaded from Google Fonts via index.html.
     Helvetica Neue / Arial stay as fallbacks for the initial paint before
     Inter finishes loading, and for kiosks that are completely offline. */
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* =======================  RESET + BASE  ================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html {
  -webkit-text-size-adjust: 100%;
  background: #ffffff;
}
body {
  color: #000;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.35;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  font-weight: 400;
  letter-spacing: 0.01em;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit;
  color: #000;
  width: 100%;
  border: 1px solid #000;
  background: #fff;
  border-radius: 0;
  padding: 10px 12px;
  transition: none;
}
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible {
  outline: 2px solid #000;
  outline-offset: -1px;
  box-shadow: none;
}
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0;
  color: #000;
}

#root {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
}

::selection { background: #000; color: #fff; }

/* =======================  APP SHELL  ===================================== */

.v2-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.v2-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background: #fff;
  border-bottom: 1px solid #000;
}

.v2-topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-right: 1px solid #000;
}
.v2-topbar__brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
}
.v2-topbar__brand-badge {
  display: inline-block;
  padding: 2px 6px;
  background: #000;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.v2-topbar__version {
  color: #666;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 16px;
  border-right: 1px solid #000;
}

.v2-topbar__nav {
  display: flex;
  margin-left: 0;
  flex: 1;
}
.v2-topbar__nav button {
  background: transparent;
  border: 0;
  border-right: 1px solid #000;
  border-radius: 0;
  padding: 14px 20px;
  color: #000;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: background 80ms;
}
.v2-topbar__nav button:hover { background: #f0f0f0; }
.v2-topbar__nav button[aria-current="page"] {
  background: #000;
  color: #fff;
}

.v2-topbar__cashier {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 8px 16px;
  border-left: 1px solid #000;
  margin-left: auto;
}
.v2-topbar__cashier-label {
  font-size: 9px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}
.v2-topbar__cashier-name {
  font-weight: 700;
  font-size: 11px;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.v2-topbar__signout {
  background: #fff;
  border: 0;
  border-left: 1px solid #000;
  border-radius: 0;
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 500;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.v2-topbar__signout:hover { background: #000; color: #fff; }

.v2-main {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: none;
  width: 100%;
  margin: 0;
}
.v2-main > * + * { border-top: 1px solid #000; }

/* =======================  LOGIN  ========================================= */

.v2-login {
  max-width: 420px;
  margin: 120px auto;
  background: #fff;
  border: 1px solid #000;
  border-radius: 0;
  padding: 40px;
}
.v2-login h1 {
  margin: 0 0 6px;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.v2-login p { margin: 0 0 28px; color: #666; font-size: 12px; letter-spacing: 0.02em; }
.v2-login label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 16px 0 6px;
}
.v2-login input { padding: 11px 12px; font-size: 13px; border: 1px solid #000; }
.v2-login button[type="submit"] {
  margin-top: 24px;
  width: 100%;
  padding: 14px;
  border: 1px solid #000;
  border-radius: 0;
  background: #000;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  transition: background 80ms, color 80ms;
}
.v2-login button[type="submit"]:hover { background: #fff; color: #000; }
.v2-login button[type="submit"]:disabled { opacity: 0.4; cursor: wait; }
.v2-login__error {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #d00000;
  background: #fff;
  color: #d00000;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =======================  WARNINGS / BOOT  =============================== */

.v2-warning {
  background: #fff;
  border: 1px solid #000;
  color: #000;
  padding: 14px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.v2-warning__icon { font-size: 14px; line-height: 1.3; color: #000; font-weight: 700; }
.v2-warning__title {
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.v2-warning__body { font-size: 12px; line-height: 1.5; letter-spacing: 0.01em; }

.v2-boot-error {
  max-width: 640px;
  margin: 60px auto;
  padding: 24px;
  border: 1px solid #d00000;
  background: #fff;
  color: #d00000;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.v2-loading {
  text-align: center;
  padding: 64px;
  color: #666;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* =======================  SHARED BUTTONS  ================================ */

.sale-btn {
  appearance: none;
  border: 1px solid #000;
  padding: 10px 16px;
  border-radius: 0;
  font-weight: 700;
  font-size: 11px;
  background: #fff;
  color: #000;
  transition: background 80ms, color 80ms;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.sale-btn:focus-visible { outline: 2px solid #000; outline-offset: 1px; }
.sale-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.sale-btn:hover:not(:disabled) { background: #000; color: #fff; }

.sale-btn--primary {
  background: #000;
  color: #fff;
  border-color: #000;
}
.sale-btn--primary:hover:not(:disabled) { background: #fff; color: #000; }

.sale-btn--accent {
  background: #000;
  color: #fff;
  border-color: #000;
}
.sale-btn--accent:hover:not(:disabled) { background: #fff; color: #000; }

.sale-btn--ghost { background: #fff; color: #000; }

.sale-btn--danger {
  background: #fff;
  color: #d00000;
  border-color: #d00000;
}
.sale-btn--danger:hover:not(:disabled) { background: #d00000; color: #fff; }

.sale-btn--sm { padding: 6px 10px; font-size: 10px; letter-spacing: 0.08em; }
.sale-btn--lg {
  padding: 16px 24px;
  font-size: 13px;
  width: 100%;
  font-weight: 700;
  letter-spacing: 0.18em;
}

/* =======================  SALE SCREEN  =================================== */

.sale { display: flex; flex-direction: column; gap: 0; padding-bottom: 120px; }
.sale > * + * { border-top: 1px solid #000; }

.sale-banner {
  display: flex;
  gap: 0;
  align-items: stretch;
  flex-wrap: wrap;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #fff;
}
.sale-banner--warn {
  background: #fff;
  display: block;
  padding: 14px 20px;
}
.sale-banner__col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 20px;
  border-right: 1px solid #000;
}
.sale-banner__col:last-child { border-right: 0; }
.sale-banner__col--grow { flex: 1; }
.sale-banner__label {
  font-size: 9px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}
.sale-banner__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sale-banner__title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.sale-banner__body { font-size: 12px; margin-top: 4px; line-height: 1.5; }

.sale-notice {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border: 0;
  background: #fff;
  font-weight: 500;
  font-size: 12px;
  border-bottom: 1px solid #000;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sale-notice--ok    { background: #fff; color: #000; }
.sale-notice--warn  { background: #fff; color: #000; }
.sale-notice--error { background: #fff; color: #d00000; }
.sale-notice--error::before { content: "◆"; margin-right: 8px; }
.sale-notice__close {
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
  font-weight: 700;
}
.sale-notice__close:hover { opacity: 1; }

.sale-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0;
  align-items: stretch;
}
@media (max-width: 1100px) { .sale-grid { grid-template-columns: 1fr; } }

.sale-panel {
  background: #fff;
  border: 0;
  border-right: 1px solid #000;
  border-radius: 0;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sale-panel--right {
  border-right: 0;
  border-left: 1px solid #000;
}
@media (max-width: 1100px) {
  .sale-panel { border-right: 0; }
  .sale-panel--right { border-left: 0; border-top: 1px solid #000; }
}

/* Floating SKU code entry — anchored bottom-right, always reachable.
   Modeled on v1's versa-sku-pad-mirror-shell but restyled for the
   brutalist monochrome language. */
.sale-code-float {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  width: 240px;
  background: #fff;
  border: 1px solid #000;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: -2px -2px 0 #000, 4px 4px 0 rgba(0, 0, 0, 0.06);
}
.sale-code-float__label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #000;
}
.sale-code-float__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 0;
  align-items: stretch;
}
.sale-code-input {
  height: 46px;
  border-radius: 0;
  background: #fff;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border: 1px solid #000;
  border-right: 0;
  letter-spacing: 0.1em;
  min-width: 0;
}
.sale-code-input::placeholder {
  color: #ccc;
  font-weight: 500;
  letter-spacing: 0.2em;
}
.sale-code-input:focus {
  outline: 2px solid #000;
  outline-offset: -2px;
}
.sale-code-float__submit {
  height: 46px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  border-radius: 0;
  transition: background 80ms, color 80ms;
}
.sale-code-float__submit:hover { background: #fff; color: #000; }
.sale-code-float__submit:focus-visible {
  outline: 2px solid #000;
  outline-offset: -2px;
}

/* On narrow screens drop the float to a full-width strip at the bottom so
   it doesn't cover anything important. */
@media (max-width: 720px) {
  .sale-code-float {
    right: 0;
    bottom: 0;
    width: 100%;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: none;
    padding: 8px 12px 12px;
  }
}

/* Lines table */
.sale-lines { display: flex; flex-direction: column; gap: 10px; }
.sale-lines__header {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.sale-lines__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
}
.sale-lines__badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sale-lines__table {
  overflow: hidden;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
}
.sale-lines__row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(160px, 1.4fr) 120px 140px 36px;
  gap: 14px;
  padding: 14px 16px;
  align-items: center;
  border-top: 1px solid #000;
}
.sale-lines__row:first-child { border-top: 0; }
.sale-lines__row--head {
  background: #000;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 16px;
}
.sale-lines__row--head > div { color: #fff; }
.sale-lines__row--placeholder { color: #999; }
.sale-lines__row:hover:not(.sale-lines__row--head):not(.sale-lines__row--placeholder) {
  background: #fafafa;
}
.col-total {
  text-align: right;
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: #000;
  letter-spacing: -0.01em;
}
.col-actions { display: flex; justify-content: flex-end; }

.sku-code {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 6px;
  border: 1px solid #000;
  color: #000;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sku-name {
  font-size: 14px;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.sku-product { font-size: 11px; color: #666; margin-top: 1px; letter-spacing: 0.02em; }

.qty-pair { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qty-input {
  width: 76px;
  padding: 8px 10px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 500;
  font-size: 13px;
}
.qty-input:focus { outline: 2px solid #000; outline-offset: -1px; }
.qty-input--price { width: 100%; font-weight: 700; font-size: 15px; }
.qty-sub {
  font-size: 10px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sale-line-remove {
  background: #fff;
  border: 1px solid #000;
  color: #000;
  font-size: 14px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 0;
  padding: 0;
  font-weight: 700;
}
.sale-line-remove:hover { background: #000; color: #fff; }

/* Totals panel */
.sale-totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: 1px solid #000;
}
.sale-totals__row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.sale-totals__value {
  font-variant-numeric: tabular-nums;
  color: #000;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sale-totals__divider { display: none; }
.sale-totals__grand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 0 0;
}
.sale-totals__grand-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #000;
  font-weight: 700;
  margin-bottom: 4px;
}
.sale-totals__grand-value {
  font-size: 56px;
  line-height: 0.92;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #000;
  letter-spacing: -0.04em;
  align-self: flex-end;
}

/* Payment picker */
.sale-payment-picker { display: flex; flex-direction: column; gap: 8px; }
.sale-payment-picker__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
  font-weight: 700;
}
.sale-payment-picker__buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid #000;
}
.sale-payment-btn {
  padding: 12px 8px;
  border: 0;
  border-right: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background 80ms, color 80ms;
}
.sale-payment-btn:last-child { border-right: 0; }
.sale-payment-btn:hover { background: #f0f0f0; }
.sale-payment-btn.is-active {
  background: #000;
  color: #fff;
}

/* Customer field */
.sale-customer { display: flex; flex-direction: column; gap: 6px; }
.sale-customer__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
  font-weight: 700;
}
.sale-customer__input { padding: 10px 12px; font-size: 13px; border: 1px solid #000; }

.sale-actions { display: flex; gap: 0; margin-top: auto; }
.sale-actions .sale-btn { flex: 1; }

/* =======================  CHECKOUT MODAL  ================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  z-index: 50;
  animation: modal-fade 80ms linear;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  width: min(680px, 100%);
  max-height: calc(100vh - 96px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid #000;
}

.modal__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid #000;
}
.modal__title {
  font-size: 14px;
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.modal__total { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; }
.modal__total-label {
  font-size: 9px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}
.modal__total-value {
  font-size: 28px;
  font-weight: 700;
  color: #000;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.modal__close {
  background: #fff;
  border: 1px solid #000;
  font-size: 16px;
  line-height: 1;
  color: #000;
  padding: 4px 10px;
  border-radius: 0;
  font-weight: 700;
}
.modal__close:hover { background: #000; color: #fff; }

.modal__body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }

.modal__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid #000;
}
.modal__tab {
  padding: 10px;
  background: #fff;
  border: 0;
  border-right: 1px solid #000;
  border-radius: 0;
  font-weight: 500;
  color: #000;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.modal__tab:last-child { border-right: 0; }
.modal__tab.is-active { background: #000; color: #fff; }

.modal__section { display: flex; flex-direction: column; gap: 14px; }
.modal__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal__field { display: flex; flex-direction: column; gap: 4px; }
.modal__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
  font-weight: 700;
}
.modal__input {
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  font-variant-numeric: tabular-nums;
}
.modal__input--lg {
  font-size: 24px;
  font-weight: 700;
  padding: 16px 18px;
  text-align: right;
  letter-spacing: -0.02em;
}

.modal__tender-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid #000;
}
.modal__tender-btn {
  padding: 10px;
  border: 0;
  border-right: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.modal__tender-btn:last-child { border-right: 0; }
.modal__tender-btn.is-active { background: #000; color: #fff; }

.modal__shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 6px;
  border: 1px solid #000;
}
.modal__shortcut {
  padding: 10px 8px;
  border: 0;
  border-right: 1px solid #000;
  border-radius: 0;
  background: #fff;
  text-align: center;
  transition: background 80ms, color 80ms;
}
.modal__shortcut:last-child { border-right: 0; }
.modal__shortcut:hover { background: #000; color: #fff; }
.modal__shortcut:hover .modal__shortcut-label,
.modal__shortcut:hover .modal__shortcut-value { color: #fff; }
.modal__shortcut-label {
  font-size: 9px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.modal__shortcut-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  margin-top: 2px;
  color: #000;
  letter-spacing: -0.01em;
}

.modal__summary {
  border: 1px solid #000;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
}
.modal__summary-row {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.modal__summary-row.is-warn { color: #d00000; font-weight: 700; }
.modal__summary-value { font-weight: 700; color: #000; letter-spacing: 0; }

.modal__help {
  font-size: 11px;
  color: #000;
  background: #f0f0f0;
  padding: 12px 14px;
  border-radius: 0;
  margin: 0;
  line-height: 1.5;
  border-left: 2px solid #000;
}

.modal__error {
  border: 1px solid #d00000;
  background: #fff;
  color: #d00000;
  padding: 10px 12px;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid #000;
  background: #fff;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* =======================  CAPTURE MODAL  ================================= */

.modal--capture { width: min(640px, 100%); }
.capture__header { gap: 16px; align-items: flex-start; padding: 18px 24px; }
.capture__eyebrow {
  font-size: 9px;
  color: #666;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.capture__product { font-size: 11px; color: #666; margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; }
.capture__pill {
  margin-left: auto;
  align-self: center;
  padding: 8px 14px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.capture__body { padding: 20px 24px; gap: 14px; }

.capture__grid { display: grid; gap: 10px; }
.capture__grid--kg {
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "weight price" "amount amount";
}
.capture__grid--box {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas: "boxes weight price" "amount amount amount";
}
.capture__grid--box > label:nth-of-type(1) { grid-area: boxes; }
.capture__grid--box > label:nth-of-type(2) { grid-area: weight; }
.capture__grid--box > label:nth-of-type(3) { grid-area: price; }
.capture__grid--kg > label:nth-of-type(1)  { grid-area: weight; }
.capture__grid--kg > label:nth-of-type(2)  { grid-area: price; }

.capture__field { display: flex; flex-direction: column; gap: 4px; }
.capture__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
}
.capture__input {
  padding: 14px 16px;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  letter-spacing: -0.02em;
}
.capture__input:focus { outline: 2px solid #000; outline-offset: -1px; }
.capture__helper {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.capture__amount {
  grid-area: amount;
  background: #000;
  border: 1px solid #000;
  border-radius: 0;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #fff;
}
.capture__amount-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #fff;
  font-weight: 700;
}
.capture__amount-value {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.capture__hint {
  font-size: 10px;
  color: #666;
  text-align: center;
  padding: 4px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* =======================  APERTURA  ====================================== */

.apertura { display: flex; justify-content: center; padding: 32px; background: #fff; }
.apertura__card {
  background: #fff;
  border: 1px solid #000;
  border-radius: 0;
  padding: 32px;
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.apertura__title { font-size: 20px; text-transform: uppercase; letter-spacing: 0.04em; }
.apertura__subtitle { margin: 2px 0 0; color: #666; font-size: 12px; line-height: 1.55; }
.apertura__form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.apertura__field { display: flex; flex-direction: column; gap: 4px; }
.apertura__field--wide { grid-column: 1 / -1; }
.apertura__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
  font-weight: 700;
}
.apertura__input, .apertura__textarea {
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  font-variant-numeric: tabular-nums;
}
.apertura__input[disabled] { color: #666; background: #f0f0f0; }
.apertura__textarea { resize: vertical; font-family: inherit; min-height: 60px; }
.apertura__actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.apertura__error {
  border: 1px solid #d00000;
  background: #fff;
  color: #d00000;
  padding: 10px 12px;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =======================  CAJA TAB  ====================================== */

.cash { display: flex; flex-direction: column; gap: 0; }
.cash > * + * { border-top: 1px solid #000; }

.cash-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: stretch;
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.cash-header__left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 24px;
  border-right: 1px solid #000;
}
.cash-header__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #666;
  font-weight: 500;
}
.cash-header__folio {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #000;
  font-variant-numeric: tabular-nums;
}
.cash-header__meta { color: #666; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.cash-header__metrics {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  align-items: stretch;
  flex: 1;
}
.cash-header__actions {
  display: flex;
  gap: 0;
  align-items: stretch;
  border-left: 1px solid #000;
}
.cash-header__actions .sale-btn {
  border: 0;
  border-left: 1px solid #000;
  padding: 14px 20px;
  height: auto;
}
.cash-header__actions .sale-btn:first-child { border-left: 0; }

.cash-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px 20px;
  border-right: 1px solid #000;
  min-width: 140px;
}
.cash-metric:last-child { border-right: 0; }
.cash-metric__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #666;
  font-weight: 500;
}
.cash-metric__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  color: #000;
  letter-spacing: -0.01em;
}
.cash-metric.is-accent { background: #000; color: #fff; }
.cash-metric.is-accent .cash-metric__label { color: #fff; }
.cash-metric.is-accent .cash-metric__value { color: #fff; font-size: 22px; }

.cash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}
@media (max-width: 1100px) { .cash-grid { grid-template-columns: 1fr; } }
.cash-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-right: 1px solid #000;
}
.cash-col > * + * { border-top: 1px solid #000; }
.cash-col:last-child { border-right: 0; }
@media (max-width: 1100px) {
  .cash-col { border-right: 0; border-bottom: 1px solid #000; }
  .cash-col:last-child { border-bottom: 0; }
}

.cash-panel {
  background: #fff;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.cash-panel__header {
  padding: 12px 20px;
  border-bottom: 1px solid #000;
  background: #fff;
}
.cash-panel__header h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #000;
  font-weight: 700;
}
.cash-panel__body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* Arqueo */
.cash-arqueo { display: flex; flex-direction: column; gap: 6px; }
.cash-arqueo__row {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  color: #000;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.cash-arqueo__value { font-weight: 700; color: #000; letter-spacing: 0; }
.cash-arqueo__divider { height: 1px; background: #000; margin: 6px 0; }
.cash-arqueo__grand { display: flex; justify-content: space-between; align-items: baseline; padding-top: 6px; border-top: 1px solid #000; margin-top: 6px; }
.cash-arqueo__grand > span:first-child {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #000;
  font-weight: 700;
}
.cash-arqueo__grand-value {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #000;
  letter-spacing: -0.03em;
}
.cash-arqueo__note {
  margin-top: 8px;
  font-size: 11px;
  color: #666;
  padding: 10px 12px;
  border-left: 2px solid #000;
  background: #f0f0f0;
  line-height: 1.55;
}

/* Departments */
.cash-dept { display: flex; flex-direction: column; gap: 0; border: 1px solid #000; }
.cash-dept__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 14px;
  border-bottom: 1px solid #000;
}
.cash-dept__row:last-child { border-bottom: 0; }
.cash-dept__label { font-weight: 700; color: #000; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.cash-dept__meta { color: #666; font-size: 11px; font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: 0.04em; }
.cash-dept__value { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: #000; }

/* Forms */
.cash-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cash-form__field { display: flex; flex-direction: column; gap: 4px; }
.cash-form__field--wide { grid-column: 1 / -1; }
.cash-form__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
  font-weight: 700;
}
.cash-form__input {
  padding: 9px 11px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.cash-form__actions { display: flex; justify-content: flex-end; gap: 6px; }
.cash-form__actions--wide { grid-column: 1 / -1; }

/* Lists */
.cash-list { display: flex; flex-direction: column; background: #fff; border-radius: 0; overflow: hidden; border: 1px solid #000; }
.cash-list__header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 10px 14px;
  background: #000;
  color: #fff;
}
.cash-list__total { font-variant-numeric: tabular-nums; color: #fff; }
.cash-list__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid #000;
}
.cash-list__primary { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cash-list__label { font-weight: 700; color: #000; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.cash-list__meta { font-size: 11px; color: #666; }
.cash-list__amount { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.cash-list__amount.is-positive { color: #000; }
.cash-list__amount.is-negative { color: #d00000; }
.cash-list__remove {
  background: #fff;
  border: 1px solid #000;
  color: #000;
  font-size: 14px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 0;
  font-weight: 700;
}
.cash-list__remove:hover { background: #d00000; color: #fff; border-color: #d00000; }

.cash-empty {
  margin: 0;
  padding: 20px;
  border: 1px solid #000;
  color: #666;
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Recent sessions */
.cash-history { display: flex; flex-direction: column; gap: 0; padding: 0; border: 1px solid #000; }
.cash-history__row {
  display: grid;
  grid-template-columns: auto 120px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 10px 14px;
  border-bottom: 1px solid #000;
  font-size: 12px;
}
.cash-history__row:last-child { border-bottom: 0; }
.cash-history__folio { font-weight: 700; font-variant-numeric: tabular-nums; color: #000; letter-spacing: -0.01em; }
.cash-history__date { color: #000; font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: 0.04em; }
.cash-history__status { color: #666; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }

/* =======================  CORTE Z MODAL  ================================= */

.modal--cortez { width: min(960px, 100%); }

.cortez-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid #000;
}
.cortez-stat {
  display: flex;
  flex-direction: column;
  border: 0;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  border-radius: 0;
  padding: 10px 14px;
  gap: 2px;
  background: #fff;
}
.cortez-stat:nth-child(4n) { border-right: 0; }
.cortez-stat:nth-last-child(-n+4) { border-bottom: 0; }
.cortez-stat__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #666;
  font-weight: 500;
}
.cortez-stat__value { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; color: #000; letter-spacing: -0.01em; }
.cortez-stat.is-accent { background: #000; }
.cortez-stat.is-accent .cortez-stat__label { color: #fff; }
.cortez-stat.is-accent .cortez-stat__value { color: #fff; }
.cortez-stat.is-pos .cortez-stat__value { color: #000; }
.cortez-stat.is-neg .cortez-stat__value { color: #d00000; }

.cortez-exchange { display: flex; gap: 12px; align-items: flex-end; max-width: 340px; }
.cortez-exchange .modal__label { min-width: 200px; }
.cortez-exchange .modal__input { flex: 1; }

.cortez-denoms {
  border: 1px solid #000;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cortez-denoms__header { display: flex; justify-content: space-between; align-items: baseline; }
.cortez-denoms__header h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
  font-weight: 700;
}
.cortez-denoms__total {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #000;
  letter-spacing: -0.01em;
}
.cortez-denoms__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.cortez-denoms__col {
  border: 1px solid #000;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
}
.cortez-denoms__col-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
  padding: 4px 4px 8px;
  border-bottom: 1px solid #000;
  margin-bottom: 4px;
}
.cortez-denom-row {
  display: grid;
  grid-template-columns: 68px 78px 1fr;
  gap: 6px;
  align-items: center;
  padding: 4px;
  font-size: 12px;
}
.cortez-denom-row__denom { font-weight: 700; font-variant-numeric: tabular-nums; color: #000; }
.cortez-denom-row__qty {
  padding: 6px 8px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 12px;
}
.cortez-denom-row__line { text-align: right; color: #000; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 500; }
.cortez-handoff { display: flex; flex-direction: column; gap: 10px; }

/* =======================  HISTORY TAB  =================================== */

.history { display: flex; flex-direction: column; gap: 0; }
.history > * + * { border-top: 1px solid #000; }

.history-header {
  display: flex;
  gap: 0;
  align-items: stretch;
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 0;
  flex-wrap: wrap;
}
.history-header__left {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-right: 1px solid #000;
}
.history-header__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #000;
}
.history-header__date {
  padding: 7px 10px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 13px;
}
.history-header__actions {
  margin-left: auto;
  display: flex;
  gap: 0;
  align-items: stretch;
}
.history-header__actions .sale-btn {
  border: 0;
  border-left: 1px solid #000;
  padding: 14px 20px;
  height: auto;
}

.history-grid {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(0, 1.4fr);
  gap: 0;
  align-items: stretch;
}
@media (max-width: 1080px) { .history-grid { grid-template-columns: 1fr; } }

.history-list {
  background: #fff;
  border: 0;
  border-right: 1px solid #000;
  border-radius: 0;
  max-height: 780px;
  overflow: auto;
}
@media (max-width: 1080px) { .history-list { border-right: 0; border-bottom: 1px solid #000; } }
.history-list__header {
  display: flex;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid #000;
  background: #000;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.history-list__spinner { color: #fff; }
.history-list__rows { display: flex; flex-direction: column; }
.history-list__more {
  width: 100%;
  border-top: 1px solid #000;
  border-radius: 0;
}

.history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px 18px;
  border: 0;
  border-top: 1px solid #000;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background 80ms;
  align-items: start;
}
.history-row:first-child { border-top: 0; }
.history-row:hover { background: #f0f0f0; }
.history-row.is-selected { background: #000; color: #fff; }
.history-row.is-selected .history-row__folio,
.history-row.is-selected .history-row__customer,
.history-row.is-selected .history-row__total,
.history-row.is-selected .history-row__meta { color: #fff; }
.history-row.is-selected .history-row__method { border-color: #fff; color: #fff; }
.history-row.is-cancelled { opacity: 0.45; }
.history-row__main { display: flex; flex-direction: column; gap: 2px; grid-column: 1 / 2; grid-row: 1; }
.history-row__folio { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 16px; color: #000; letter-spacing: -0.01em; }
.history-row__customer {
  font-size: 12px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.history-row__total { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 16px; grid-column: 2; grid-row: 1; color: #000; letter-spacing: -0.01em; }
.history-row__meta {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  color: #666;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.history-row__method {
  padding: 1px 6px;
  border: 1px solid #000;
  color: #000;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 9px;
}
.history-row__method.method-credit,
.history-row__method.method-transfer { background: #000; color: #fff; }
.history-row__time { font-variant-numeric: tabular-nums; }
.history-row__doc { font-weight: 700; letter-spacing: 0.08em; }
.history-row__doc.doc-stamped { color: #000; }
.history-row__doc.doc-stamp_error { color: #d00000; }
.history-row__needs { color: #000; font-weight: 700; }
.history-row__cancelled { color: #d00000; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.history-detail {
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.history-detail--empty {
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.history-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #000;
}
.history-detail__folio { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: #000; letter-spacing: -0.03em; }
.history-detail__date { color: #666; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.history-detail__status {
  padding: 4px 10px;
  border: 1px solid #000;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.history-detail__status.is-ok { background: #000; color: #fff; }
.history-detail__status.is-cancelled { background: #d00000; color: #fff; border-color: #d00000; }

.history-detail__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  border: 1px solid #000;
}
.history-detail__meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}
.history-detail__meta-row:nth-child(2n) { border-right: 0; }
.history-detail__meta-row:nth-last-child(-n+2) { border-bottom: 0; }
.history-detail__meta-row dt {
  font-size: 9px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.history-detail__meta-row dd { margin: 0; font-weight: 700; text-align: right; color: #000; font-size: 12px; }

.history-detail__lines { display: flex; flex-direction: column; gap: 0; border: 1px solid #000; }
.history-detail__lines-title {
  display: none;
}
.history-detail__line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #000;
  font-size: 12px;
  align-items: baseline;
}
.history-detail__line:last-child { border-bottom: 0; }
.history-detail__line-name { font-weight: 700; color: #000; text-transform: uppercase; letter-spacing: 0.02em; }
.history-detail__line-qty { color: #666; font-variant-numeric: tabular-nums; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.history-detail__line-total { font-weight: 700; font-variant-numeric: tabular-nums; }

.history-detail__totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid #000;
}
.history-detail__total-row {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.history-detail__total-row.is-accent { color: #d00000; font-weight: 700; }
.history-detail__total-value { font-size: 28px; font-weight: 700; color: #000; letter-spacing: -0.03em; }

.history-detail__cancelled {
  border: 1px solid #d00000;
  color: #d00000;
  padding: 14px;
  background: #fff;
}
.history-detail__cancelled-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; margin-bottom: 8px; }
.history-detail__cancelled .history-detail__meta-row dt { color: inherit; opacity: 0.75; }
.history-detail__cancelled .history-detail__meta-row dd { color: inherit; }

.history-detail__actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid #000; }
.history-detail__actions .sale-btn { border: 0; border-right: 1px solid #000; border-bottom: 1px solid #000; padding: 12px; }
.history-detail__actions .sale-btn:nth-child(2n) { border-right: 0; }
.history-detail__actions .sale-btn:nth-last-child(-n+2) { border-bottom: 0; }

.history-sku-totals__grand { font-variant-numeric: tabular-nums; font-weight: 700; color: #000; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.history-sku-totals__grid { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid #000; }
.history-sku-totals__row {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #000;
  align-items: baseline;
  font-size: 12px;
}
.history-sku-totals__row:last-child { border-bottom: 0; }
.history-sku-totals__code { font-weight: 500; font-variant-numeric: tabular-nums; color: #666; font-size: 11px; }
.history-sku-totals__name { font-weight: 700; color: #000; text-transform: uppercase; letter-spacing: 0.02em; }
.history-sku-totals__qty { font-variant-numeric: tabular-nums; color: #666; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.history-sku-totals__amount { font-variant-numeric: tabular-nums; font-weight: 700; color: #000; }

.modal__checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid #000;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  color: #000;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modal__checkbox input { margin-top: 2px; accent-color: #000; }

/* =======================  FISCAL TAB  ==================================== */

.fiscal { display: flex; flex-direction: column; gap: 0; }
.fiscal > * + * { border-top: 1px solid #000; }

.fiscal-readiness {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 14px 24px;
}
.fiscal-readiness__left { display: flex; flex-direction: column; gap: 2px; }
.fiscal-readiness__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #666;
  font-weight: 500;
}
.fiscal-readiness__body { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.fiscal-readiness__ok { color: #000; font-weight: 700; }
.fiscal-readiness__err { color: #d00000; font-weight: 500; }
.fiscal-readiness__providers { color: #666; font-variant-numeric: tabular-nums; }

.fiscal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 0;
  align-items: stretch;
}
.fiscal-panel {
  background: #fff;
  border: 0;
  border-right: 1px solid #000;
  border-radius: 0;
  overflow: hidden;
}
.fiscal-panel:last-child { border-right: 0; }
@media (max-width: 1100px) {
  .fiscal-panel { border-right: 0; border-bottom: 1px solid #000; }
  .fiscal-panel:last-child { border-bottom: 0; }
}
.fiscal-panel__header {
  padding: 12px 20px;
  border-bottom: 1px solid #000;
  background: #fff;
}
.fiscal-panel__header h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #000;
  font-weight: 700;
}
.fiscal-panel__body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.fiscal-find { display: flex; gap: 0; }
.fiscal-find__input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #000;
  border-right: 0;
  border-radius: 0;
  background: #fff;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.fiscal-find .sale-btn { border-radius: 0; }

.fiscal-sale {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid #000;
  background: #fff;
}
.fiscal-sale__primary { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fiscal-sale__folio { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: #000; letter-spacing: -0.02em; }
.fiscal-sale__customer { font-weight: 700; color: #000; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.fiscal-sale__meta { font-size: 11px; color: #666; font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: 0.06em; }

.fiscal-docs { display: flex; flex-direction: column; gap: 0; margin-top: 6px; border: 1px solid #000; }
.fiscal-docs__title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
  background: #000;
  padding: 8px 14px;
}
.fiscal-doc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 0;
  border-top: 1px solid #000;
  border-radius: 0;
}
.fiscal-doc:first-of-type { border-top: 0; }
.fiscal-doc.doc-stamped { background: #fff; }
.fiscal-doc.doc-stamp_error { background: #fff; color: #d00000; }
.fiscal-doc__label { font-weight: 700; color: inherit; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.fiscal-doc__uuid { font-size: 10px; color: #666; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.fiscal-doc__links { display: flex; gap: 4px; }

.fiscal-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fiscal-form__actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }

/* =======================  PLACEHOLDERS  ================================== */

.v2-placeholder {
  background: #fff;
  border: 1px dashed #000;
  border-radius: 0;
  padding: 72px 32px;
  text-align: center;
  color: #666;
}
.v2-placeholder h2 {
  color: #000;
  margin: 0 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.v2-placeholder p { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
