:root {
  --plum: #35103f;
  --plum-2: #50125d;
  --lime: #c7df35;
  --pink: #ed2f87;
  --yellow: #f2c94c;
  --ink: #1d1c20;
  --muted: #706b74;
  --line: #e5e2e7;
  --soft: #f5f4f6;
  --white: #fff;
  --success: #16845b;
  --danger: #b72c43;
  --warning: #a16207;
  --shadow: 0 18px 48px rgba(39, 19, 44, 0.16);
  color: var(--ink);
  background: var(--soft);
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--soft); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--soft); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(237, 47, 135, 0.23); outline-offset: 1px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; line-height: 1.15; }
h2 { font-size: 19px; line-height: 1.25; }

.login-screen {
  display: grid;
  grid-template-columns: minmax(390px, 520px) minmax(380px, 1fr);
  min-height: 100vh;
  background: var(--plum);
}
.login-panel {
  display: grid;
  align-content: center;
  gap: 28px;
  padding: clamp(34px, 6vw, 82px);
  background: var(--white);
}
.login-brand { display: flex; align-items: center; width: max-content; }
.login-brand img { display: block; width: 176px; height: auto; }
.login-brand small { margin-left: 9px; color: var(--muted); font-size: 10px; letter-spacing: 0; }
.login-panel h1 { font-size: 35px; }
.login-copy { max-width: 450px; margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.login-panel form { display: grid; gap: 12px; }
.login-button { width: 100%; margin-top: 2px; }
.demo-access { display: grid; gap: 7px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: var(--muted); font-size: 11px; }
.demo-access strong { color: var(--ink); }
.demo-access code { padding: 2px 4px; border-radius: 3px; background: var(--white); color: var(--plum); font-family: ui-monospace, monospace; font-weight: 700; }
.local-note { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.local-note svg { width: 17px; flex: 0 0 auto; color: var(--success); }
.login-context { display: grid; align-content: center; gap: 26px; max-width: 720px; padding: clamp(44px, 8vw, 110px); color: var(--white); }
.login-context .eyebrow { color: var(--lime); }
.login-context h2 { max-width: 590px; font-size: clamp(29px, 4vw, 50px); line-height: 1.08; }
.login-feature { display: grid; grid-template-columns: 42px 1fr; align-items: start; gap: 13px; max-width: 520px; }
.login-feature > svg { width: 40px; height: 40px; padding: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); color: var(--lime); }
.login-feature span { display: grid; gap: 4px; color: #d9cddd; font-size: 12px; line-height: 1.5; }
.login-feature strong { color: var(--white); font-size: 13px; }

.app-shell {
  display: grid;
  grid-template-columns: 84px minmax(540px, 1fr) minmax(320px, 370px);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  padding: 15px 9px;
  background: var(--plum);
  color: var(--white);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 46px;
  padding: 5px;
  border: 0;
  border-radius: 5px;
  background: var(--white);
}
.brand img { display: block; width: 100%; height: auto; }
.brand:hover { background: #f5f5f5; }

.nav-list { display: grid; gap: 4px; width: 100%; margin-top: 20px; overflow-y: auto; scrollbar-width: none; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-item {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d5c8d9;
  font-size: 10px;
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.nav-item.active { background: var(--lime); color: var(--plum); font-weight: 700; }
body[data-role="cashier"] .nav-item:not([data-view="caja"]):not([data-view="turnos"]) { display: none; }
.profile-button {
  width: 40px;
  height: 40px;
  margin-top: auto;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: var(--pink);
  color: var(--white);
  font-weight: 700;
}

.workspace { min-width: 0; padding: 22px 26px 36px; overflow: hidden; }
.topbar, .checkout-header, .section-heading, .panel-heading, .dialog-heading, .action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.session-user { display: grid; min-width: 118px; padding-left: 10px; border-left: 1px solid var(--line); }
.session-user strong { max-width: 180px; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.session-user span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.branch-field, .customer-field, .form-field { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 600; }
.branch-field select, .customer-field select, .form-field input, .form-field select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  outline: none;
}
.branch-field select { min-width: 210px; padding: 0 32px 0 11px; }
.branch-field.locked select { cursor: not-allowed; background: #f1eff2; color: #554f58; opacity: 1; }
.customer-field { flex: 1; }
.customer-field select { width: 100%; padding: 0 10px; }
.form-field input, .form-field select { width: 100%; padding: 0 11px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #edd6b3;
  border-radius: 6px;
  background: #fff8eb;
  color: #83500b;
  font-size: 11px;
  white-space: nowrap;
}
.status-chip > span { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.status-chip.open { border-color: #c9e8da; background: #edf9f3; color: #116c4b; }
.status-chip.open > span { background: var(--success); }
.local-clock { display: grid; justify-items: end; min-width: 58px; }
.local-clock span { color: var(--plum); font-size: 15px; font-weight: 700; }
.local-clock small { color: var(--muted); font-size: 9px; text-transform: capitalize; }
.view-content { min-width: 0; margin-top: 20px; }

.shift-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.shift-strip > div { display: grid; gap: 5px; padding: 13px 16px; border-right: 1px solid var(--line); }
.shift-strip > div:last-child { border-right: 0; }
.shift-strip span { color: var(--muted); font-size: 11px; }
.shift-strip strong { font-size: 18px; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.catalog-toolbar { display: grid; gap: 10px; margin-bottom: 18px; }
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 250px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.search-field svg { width: 18px; flex: 0 0 auto; color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.catalog-search { width: 100%; }
.category-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; width: 100%; min-width: 0; }
.category-tabs button {
  min-width: 0;
  height: 39px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  white-space: normal;
}
.category-tabs button.active { border-color: var(--plum); background: var(--plum); color: var(--white); }
.family-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 18px; }
.family-tabs button { min-height: 34px; padding: 0 12px; border: 1px solid #dcd6df; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.family-tabs button:hover { border-color: #ada5b2; color: var(--plum); }
.family-tabs button.active { border-color: #d9e78b; background: #eef4c7; color: #53620b; }
.muted { color: var(--muted); font-size: 12px; }
.section-heading { margin-bottom: 14px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  max-height: calc(100vh - 330px);
  padding: 1px 4px 24px 1px;
  overflow-y: auto;
}
.product-card {
  display: grid;
  grid-template-rows: 112px auto;
  min-height: 196px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.product-card:hover:not(:disabled) { transform: translateY(-2px); border-color: #b9b3bd; box-shadow: 0 8px 20px rgba(44, 31, 47, 0.09); }
.product-card:active:not(:disabled) { transform: translateY(0); }
.product-card.sold-out { cursor: not-allowed; opacity: 0.5; }
.product-visual { position: relative; display: block; overflow: hidden; background: #eeeaf0; }
.product-visual img { width: 100%; height: 112px; object-fit: cover; }
.stock-pill { position: absolute; right: 7px; bottom: 7px; padding: 3px 6px; border-radius: 4px; background: rgba(29, 28, 32, 0.82); color: white; font-size: 9px; font-weight: 700; }
.stock-pill.low { background: #8d5708; }
.product-copy { display: grid; align-content: space-between; gap: 9px; padding: 11px 12px 12px; }
.product-name { min-height: 36px; font-size: 13px; font-weight: 700; line-height: 1.35; }
.product-family { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.variant-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.variant-list:has(button:only-child) { grid-template-columns: 1fr; }
.variant-list button { display: flex; align-items: center; justify-content: space-between; min-width: 0; min-height: 34px; padding: 0 8px; border: 1px solid #dcd6df; border-radius: 5px; background: var(--soft); color: var(--ink); font-size: 9px; font-weight: 700; }
.variant-list button:hover:not(:disabled) { border-color: var(--plum); background: #f5edf7; color: var(--plum); }
.variant-list button:disabled { cursor: not-allowed; opacity: .45; }
.variant-list strong { color: var(--plum-2); font-size: 11px; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-meta strong { color: var(--plum-2); font-size: 15px; }
.product-tag { padding: 3px 6px; border-radius: 4px; background: #eef4c7; color: #53620b; font-size: 9px; font-weight: 700; }

.checkout {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto minmax(120px, 1fr) auto auto auto;
  gap: 16px;
  height: 100vh;
  padding: 22px 20px;
  border-left: 1px solid var(--line);
  background: var(--white);
  box-shadow: -8px 0 30px rgba(45, 27, 48, 0.04);
}
body:not([data-view="caja"]) .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
body:not([data-view="caja"]) .checkout { display: none; }
body[data-role="admin"] .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
body[data-role="admin"] .checkout, body[data-role="admin"] .nav-item[data-view="caja"] { display: none; }
.customer-row { display: flex; align-items: end; gap: 7px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
}
.icon-button:hover { border-color: #bcb7c0; }
.icon-button svg { width: 18px; height: 18px; }
.icon-button.small { width: 32px; height: 32px; }
.icon-button.small svg { width: 15px; }
.cart-lines { min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty-cart, .empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  height: 100%;
  min-height: 180px;
  color: var(--muted);
  text-align: center;
}
.empty-cart svg, .empty-state svg { width: 30px; height: 30px; color: #b8b2bc; }
.empty-cart strong, .empty-state strong { color: var(--ink); font-size: 14px; }
.empty-cart span, .empty-state span { font-size: 12px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.line-name { display: grid; align-content: start; gap: 4px; }
.line-name strong { font-size: 13px; }
.line-name span { color: var(--muted); font-size: 11px; }
.line-right { display: grid; justify-items: end; gap: 7px; }
.price-before { color: var(--muted); font-size: 10px; text-decoration: line-through; }
.line-discount-field { display: grid; gap: 4px; margin-top: 5px; }
.line-discount-field > span:first-child { font-size: 9px; }
.money-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; width: 92px; height: 30px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
.money-field:focus-within { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(237, 47, 135, 0.12); }
.money-field small { padding-left: 8px; color: var(--muted); font-size: 10px; }
.money-field input { width: 100%; min-width: 0; height: 100%; padding: 0 6px 0 3px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; text-align: right; }
.quantity-control { display: grid; grid-template-columns: 28px 28px 28px; height: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; }
.quantity-control button { border: 0; background: var(--soft); font-weight: 700; }
.quantity-control span { display: grid; place-items: center; font-size: 12px; }
.checkout-summary { display: grid; gap: 8px; }
.checkout-summary > div { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.checkout-summary strong { color: var(--ink); }
.order-discount-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 400; }
.order-discount-field .money-field { width: 98px; }
.checkout-summary .total-row { align-items: baseline; padding-top: 9px; border-top: 1px dashed #ccc5cf; color: var(--ink); font-size: 15px; font-weight: 700; }
.total-row strong { color: var(--plum-2); font-size: 24px; }
.payment-block { display: grid; gap: 8px; }
.field-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.segmented button { display: grid; place-items: center; gap: 3px; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--muted); font-size: 10px; font-weight: 600; }
.segmented button svg { width: 17px; height: 17px; }
.segmented button.active { border-color: var(--plum); background: #f5edf7; color: var(--plum); }
.charge-button { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 18px; border: 0; border-radius: 7px; background: var(--pink); color: var(--white); font-weight: 700; }
.charge-button:hover:not(:disabled) { background: #d92376; }
.charge-button:disabled { cursor: not-allowed; opacity: 0.45; }
.charge-button strong { font-size: 18px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 11px; margin-bottom: 18px; }
.metric-grid.compact-metrics { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
.metric { position: relative; display: grid; min-height: 132px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.metric-icon { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: #f2eaf4; color: var(--plum-2); }
.metric-icon svg { width: 18px; }
.metric > span { align-self: end; padding-right: 38px; color: var(--muted); font-size: 11px; }
.metric > strong { margin-top: 5px; font-size: 24px; }
.metric > small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.metric.warning .metric-icon { background: #fff3dc; color: var(--warning); }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-bottom: 14px; }
.national-panel { margin-bottom: 14px; }
.panel, .table-panel, .settings-list { border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.panel { padding: 18px; }
.panel-heading { margin-bottom: 17px; }
.progress-row { display: grid; grid-template-columns: minmax(120px, 0.8fr) minmax(100px, 1fr) 36px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.progress-row:last-child { border-bottom: 0; }
.progress-row > div:first-child { display: flex; justify-content: space-between; gap: 9px; font-size: 11px; }
.progress-row small { color: var(--muted); text-align: right; }
.progress-track { height: 7px; overflow: hidden; border-radius: 4px; background: #ebe8ed; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--pink); }
.rank-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.rank-row:last-child { border-bottom: 0; }
.rank-row > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #f0eef1; color: var(--muted); font-size: 10px; }
.compact-list > div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.compact-list > div:last-child { border-bottom: 0; }
.compact-list > div > span:last-child { color: var(--muted); }
.empty-inline { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 86px; color: var(--muted); font-size: 12px; }
.empty-inline svg { width: 19px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--plum-2); font-size: 11px; font-weight: 700; }
.text-button svg { width: 15px; }

.action-bar { margin-bottom: 13px; }
.action-bar .search-field { width: min(410px, 100%); }
.inline-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: auto; min-width: max-content; padding: 0 14px; }
.inline-button svg { width: 16px; }
.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 14px; background: #f4f2f5; color: var(--muted); font-size: 10px; font-weight: 700; text-align: left; text-transform: uppercase; }
td { padding: 13px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #fcfbfc; }
.align-right { text-align: right; }
.table-link { padding: 0; border: 0; background: transparent; color: var(--plum-2); font-weight: 700; }
.table-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 7px; border-radius: 4px; background: #edf5cb; color: #52610c; font-size: 9px; font-weight: 700; }
.muted-tag { background: #efedf0; color: #615c64; }
.warning-tag { background: #fff1d8; color: var(--warning); }
.legend { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 10px; }
.legend span, .stock-state { display: inline-flex; align-items: center; gap: 6px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger { background: var(--danger); }

.settings-list { margin-bottom: 14px; overflow: hidden; }
.settings-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px; background: #f2edf3; color: var(--plum-2); }
.settings-icon svg { width: 19px; }
.settings-row strong { font-size: 13px; }
.settings-row p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.danger-zone p:not(.eyebrow) { margin-top: 5px; color: var(--muted); font-size: 11px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.app-dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 30px);
  padding: 24px;
  overflow-y: auto;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.app-dialog::backdrop { background: rgba(28, 13, 31, 0.62); backdrop-filter: blur(2px); }
.compact-dialog { width: min(440px, calc(100vw - 28px)); }
.dialog-heading { margin-bottom: 16px; }
.dialog-copy { margin-bottom: 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; border-radius: 6px; font-weight: 700; }
.primary-button { border: 0; background: var(--plum); color: var(--white); }
.primary-button:hover { background: #481151; }
.secondary-button { border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.danger-button { border: 1px solid #efc6cd; background: #fff4f5; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field.full { grid-column: 1 / -1; }
.check-field { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.check-field input { margin: 1px 0 0; accent-color: var(--plum); }
.form-error { min-height: 18px; margin-top: 7px; color: var(--danger); font-size: 11px; }
.change-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 11px; padding: 12px; border-radius: 6px; background: #f3f1f4; font-size: 12px; }
.change-row strong { color: var(--success); font-size: 20px; }
.cash-shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
.cash-shortcuts button { min-height: 38px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--plum); font-size: 11px; font-weight: 700; }
.cash-shortcuts button:hover:not(:disabled) { border-color: var(--plum); background: #f5edf7; }
.cash-shortcuts button:disabled { cursor: not-allowed; opacity: .35; }
[hidden] { display: none !important; }
.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0; padding: 13px; border-radius: 6px; background: var(--soft); }
.receipt-meta div { display: grid; gap: 3px; }
.receipt-meta span { color: var(--muted); font-size: 9px; }
.receipt-meta strong { font-size: 11px; }
.receipt-lines { border-top: 1px solid var(--line); }
.receipt-lines > div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.receipt-total { display: flex; align-items: baseline; justify-content: space-between; padding: 15px 0; font-weight: 700; }
.receipt-total strong { color: var(--plum-2); font-size: 22px; }
.receipt-discount { display: flex; justify-content: space-between; gap: 18px; padding: 7px 0; color: var(--muted); font-size: 11px; }
.receipt-discount strong { color: var(--ink); }
.chart-grid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); }
.chart-panel { min-width: 0; }
.chart-holder { position: relative; width: 100%; height: 260px; }
.chart-donut { max-width: 330px; margin-inline: auto; }
.chart-report { height: 300px; }
.chart-products { height: 310px; }
.report-main-chart { margin-bottom: 14px; }
.chart-fallback { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 11px; text-align: center; }
.info-banner { display: flex; align-items: flex-start; gap: 8px; padding: 11px; border-radius: 6px; background: #fff5e3; color: #764a0d; font-size: 10px; line-height: 1.5; }
.info-banner svg { width: 16px; flex: 0 0 auto; }
.info-banner div { display: grid; gap: 4px; }
.info-banner strong { font-size: 11px; }
.info-banner p { margin: 0; }
.fiscal-banner { margin-bottom: 14px; }
.stock-explainer { margin-bottom: 13px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: min(360px, calc(100vw - 40px)); padding: 12px 15px; border-radius: 6px; background: #173f32; color: white; box-shadow: var(--shadow); font-size: 12px; font-weight: 600; opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast[data-tone="warning"] { background: #7a4d0d; }

body:not([data-role="manager"]) .nav-item[data-view="descuentos"] { display: none; }
.storage-issue { display: grid; gap: 24px; max-width: 660px; margin: 12vh auto; padding: 28px; line-height: 1.6; }
.payment-discounts { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.payment-discounts summary { color: var(--plum); font-size: 13px; font-weight: 700; cursor: pointer; }
.payment-discounts > p { margin-block: 12px; }
.payment-discount-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px; align-items: center; gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.payment-discount-row > span:first-child { display: grid; gap: 4px; }
.payment-discount-row small { color: var(--muted); font-size: 10px; }
.payment-discount-row input { width: 100%; min-width: 0; }
.payment-discounts .order-discount-field { margin-top: 14px; }
.payment-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; font-size: 13px; }
.payment-total strong { color: var(--plum); font-size: 27px; }
.transfer-fields { display: grid; gap: 12px; margin-bottom: 16px; }
.app-dialog .form-field + .form-field { margin-top: 12px; }
#discountReviewNotice { margin-top: 12px; }
.change-row strong.text-warning { color: var(--warning); }
.shift-totals { display: grid; gap: 10px; padding: 14px; margin-bottom: 16px; border-radius: 8px; background: var(--soft); font-size: 12px; }
.shift-totals > div { display: flex; justify-content: space-between; gap: 18px; }
.review-list { display: grid; gap: 12px; }
.review-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.review-card > div { display: grid; gap: 7px; min-width: 0; overflow-wrap: anywhere; }
.review-card p { font-size: 12px; line-height: 1.5; }
.review-card .review-amount { color: var(--plum); font-size: 22px; font-weight: 700; text-align: right; }
.review-card button { min-height: 42px; }
.primary-button:disabled { cursor: not-allowed; opacity: .5; }
@media (max-width: 620px) { .review-card { grid-template-columns: 1fr; } .review-card .review-amount { text-align: left; } }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 72px minmax(450px, 1fr) 320px; }
  body:not([data-view="caja"]) .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .workspace { padding-inline: 18px; }
  .sidebar { padding-inline: 6px; }
  .branch-field select { min-width: 175px; }
  .local-clock { display: none; }
  .shift-strip { grid-template-columns: repeat(2, 1fr); }
  .shift-strip > div:nth-child(2) { border-right: 0; }
  .shift-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .product-grid { max-height: calc(100vh - 380px); }
  .metric-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-panel { min-height: 100vh; }
  .login-context { display: none; }
  .app-shell, body:not([data-view="caja"]) .app-shell { grid-template-columns: 64px minmax(0, 1fr); }
  body[data-role="admin"] .app-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { grid-row: 1 / span 2; }
  .workspace { overflow: visible; }
  .checkout { position: static; grid-column: 2; height: auto; min-height: 650px; border-top: 1px solid var(--line); border-left: 0; }
  .product-grid { max-height: none; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .login-panel { padding: 28px 22px; }
  .workspace { padding: 17px 12px 28px; }
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 21px; }
  .topbar-actions { align-items: flex-end; flex-direction: column; }
  .session-user { display: none; }
  .branch-field select { min-width: 150px; max-width: 170px; }
  .status-chip { height: 34px; }
  .shift-strip { grid-template-columns: 1fr 1fr; }
  .shift-strip > div { padding: 11px; }
  .shift-strip strong { font-size: 15px; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .product-card { grid-template-rows: 94px auto; min-height: 180px; }
  .product-visual img { height: 94px; }
  .checkout { padding: 20px 13px; }
  .metric-grid, .metric-grid.compact-metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 120px; padding: 13px; }
  .metric > strong { font-size: 20px; }
  .action-bar { align-items: stretch; flex-direction: column; }
  .legend { flex-wrap: wrap; }
  .settings-row { grid-template-columns: 38px minmax(0, 1fr); }
  .settings-row > .tag { grid-column: 2; justify-self: start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .button-row { width: 100%; }
  .button-row .inline-button { flex: 1; }
}

@media (max-width: 430px) {
  .metric-grid, .metric-grid.compact-metrics { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 112px 1fr; grid-template-rows: 126px; min-height: 126px; }
  .product-visual img { height: 126px; }
  .product-name { min-height: 0; }
}

/* Turnos y arqueos */
.cash-intro { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 8px 0 24px; }
.cash-intro p { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.cash-intro small, .cash-active p, .cash-active-actions small, .cash-figures span, .cash-result-grid span { color: var(--muted); line-height: 1.6; }
.cash-active-list { display: grid; gap: 18px; margin: 22px 0; }
.cash-active { border-top: 4px solid var(--lime); }
.cash-active-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cash-active-heading h2 { margin: 6px 0; }
.cash-active-heading p { margin-bottom: 0; }
.cash-figures { display: flex; gap: 40px; margin: 22px 0; padding: 18px 0; border-block: 1px solid var(--line); }
.cash-figures div, .cash-result-grid div { display: grid; gap: 8px; }
.cash-figures strong { font-size: 23px; }
.cash-active-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cash-active-actions small { max-width: 430px; }
.cash-empty { text-align: center; padding: 28px; }
.cash-empty > svg { color: var(--plum); width: 32px; height: 32px; }
.cash-history { padding-bottom: 8px; }
.cash-outcome { display: inline-block; border-radius: 6px; padding: 6px 9px; white-space: nowrap; font-size: 12px; }
.cash-outcome.balanced, .cash-result-difference.balanced { color: #216448; background: #e6f4ed; }
.cash-outcome.difference, .cash-result-difference.difference, .cash-warning { color: #884000; background: #fff1df; }
.cash-warning { padding: 12px; border-radius: 8px; }
.cash-dialog { max-width: min(540px, calc(100vw - 24px)); }
.cash-amount-field input { font-size: 30px; height: 64px; font-weight: 700; }
.form-field textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; font: inherit; }
.cash-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; margin: 24px 0; }
.cash-result-grid strong { font-size: 23px; }
.cash-result-difference { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-radius: 12px; margin-bottom: 20px; }
.cash-result-difference strong { font-size: 28px; }
.cash-note { border-left: 3px solid var(--lime); padding: 12px; line-height: 1.6; }
@media (max-width: 620px) {
  .cash-intro { flex-direction: column; align-items: stretch; }
  .cash-figures { gap: 16px; flex-wrap: wrap; }
  .cash-active-heading { flex-direction: column; }
  .cash-active-actions > button { flex: 1; }
  .cash-dialog .dialog-actions { flex-wrap: wrap; }
}
.connection-notice { position: sticky; top: 0; z-index: 50; background: #fff1df; color: #693700; padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; }
.connection-notice[hidden] { display: none; }
#quickCustomerSearch { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12px; }
