:root {
  --ink: #191411;
  --muted: #756a63;
  --paper: #f5f0e8;
  --surface: #fffdf8;
  --surface-2: #eee6db;
  --line: #ddd3c7;
  --red: #c64036;
  --red-dark: #9e2e28;
  --red-soft: #f4d9d5;
  --green: #416a4a;
  --amber: #a8712d;
  --shadow: 0 18px 60px rgba(54, 37, 25, 0.12);
  --radius: 20px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 8%, rgba(198, 64, 54, 0.11), transparent 27rem),
    var(--paper);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.pull-refresh {
  --pull-shift: 0px;
  position: fixed;
  left: 50%;
  top: max(8px, env(safe-area-inset-top));
  z-index: 180;
  min-width: 154px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 248, .94);
  box-shadow: 0 8px 24px rgba(54, 37, 25, .16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-64px + var(--pull-shift)));
  transition: opacity .14s, transform .18s;
  backdrop-filter: blur(12px);
}
.pull-refresh small { font-size: 10px; font-weight: 850; }
.pull-refresh-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-size: 13px;
  font-weight: 900;
  transition: transform .16s;
}
body.pulling .pull-refresh,
body.pull-refreshing .pull-refresh { opacity: 1; }
.pull-refresh.ready .pull-refresh-icon { transform: rotate(180deg); }
body.pull-refreshing .pull-refresh-icon {
  animation: pull-refresh-spin .7s linear infinite;
}
body.pull-refreshing .pull-refresh small { font-size: 0; }
body.pull-refreshing .pull-refresh small::after {
  content: "Actualizando…";
  font-size: 10px;
}
@keyframes pull-refresh-spin {
  to { transform: rotate(360deg); }
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  z-index: 99;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 480px);
  padding: 52px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 32px;
  background: rgba(255, 253, 248, .88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-mark {
  width: 92px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  background: #34382a;
  box-shadow: 0 8px 22px rgba(31, 34, 25, .16);
}

.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-mark.small { width: 44px; border-radius: 11px; }
.eyebrow {
  margin: 22px 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.login-card h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(38px, 7vw, 58px); line-height: .98; }
.login-copy { margin: 18px 0 30px; color: var(--muted); line-height: 1.6; }
label { color: var(--muted); font-size: 13px; font-weight: 700; }
.password-row { display: flex; gap: 10px; margin-top: 8px; }

input, select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(198,64,54,.1);
}

.primary, .ghost, .icon-button, .text-button, .nav-item, .action-button {
  border: 0;
  border-radius: 12px;
  transition: transform .16s, background .16s, color .16s, border-color .16s;
}
.primary {
  min-height: 44px;
  padding: 0 18px;
  color: #fff;
  background: var(--red);
  font-weight: 800;
}
.primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.ghost {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  font-weight: 750;
}
.ghost:hover { border-color: #b5a89c; background: var(--surface); }
.full { width: 100%; }
.text-button { padding: 10px; color: var(--muted); background: transparent; }
.text-button:hover { color: var(--red); }
.form-error { min-height: 20px; margin: 8px 0 0; color: var(--red); font-size: 13px; }
.passkey-hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: center; }
#passkeyLoginButton { margin-top: 4px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.08);
  color: #fff;
  background: #17120f;
}
.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 54px; }
.brand strong { display: block; font-family: Georgia, serif; font-size: 22px; }
.brand span { color: #a99d95; font-size: 12px; }
nav { display: grid; gap: 8px; }
.nav-item {
  width: 100%;
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  color: #c8beb8;
  background: transparent;
  text-align: left;
  font-weight: 700;
}
.nav-item:hover, .nav-item.active { color: #fff; background: #2b211c; }
kbd {
  padding: 2px 6px;
  border: 1px solid #4e4038;
  border-radius: 5px;
  color: #8f8179;
  font-family: inherit;
  font-size: 10px;
}
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; }
.sidebar .ghost { color: #fff; border-color: #443831; }
.sidebar .ghost:hover { background: #2b211c; }

main { min-width: 0; padding: 34px clamp(24px, 4vw, 58px) 70px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.topbar .eyebrow { margin: 0 0 7px; }
.topbar h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(32px, 4vw, 48px); font-weight: 500; }
.sync-copy { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.bcv-rate {
  width: fit-content;
  margin-top: 11px;
  padding: 8px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, auto);
  align-items: baseline;
  gap: 3px 9px;
  border: 1px solid #d8c9b9;
  border-radius: 11px;
  background: rgba(255, 253, 248, .78);
}
.bcv-rate span { color: var(--red); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.bcv-rate strong { font-size: 13px; }
.bcv-rate time { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.bcv-rate small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.topbar-actions { display: flex; gap: 10px; }
.mobile-menu { display: none; }

.stats-grid {
  margin: 32px 0 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  min-height: 142px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,253,248,.72);
}
.stat-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-card strong { display: block; margin: 7px 0 5px; font-family: Georgia, serif; font-size: 42px; font-weight: 500; }
.stat-card small { color: var(--muted); }
.stat-card.accent { color: #fff; border-color: var(--red); background: var(--red); }
.stat-card.accent span, .stat-card.accent small { color: #f8dcd8; }
.stat-card.warning strong { color: var(--amber); }
.stat-card.filter-card {
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.stat-card.filter-card:hover { border-color: var(--amber); }
.stat-card.filter-card:active { transform: scale(.985); }
.stat-card.filter-card:focus-visible {
  outline: 3px solid rgba(171, 112, 30, .25);
  outline-offset: 3px;
}
.stat-card.filter-card.active {
  border-color: var(--amber);
  background: #fff1d8;
  box-shadow: inset 0 0 0 1px var(--amber), 0 8px 24px rgba(126, 82, 23, .12);
}
.stat-card.filter-card.active small::after {
  content: " · Toca para ver todos";
  font-weight: 750;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 220px) minmax(150px, 190px) minmax(150px, 180px);
  gap: 12px;
  margin-bottom: 12px;
}
.search { position: relative; }
.search span { position: absolute; left: 16px; top: 11px; color: var(--muted); font-size: 22px; }
.search input { padding-left: 45px; }

.catalog-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.quick-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, .76);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.filter-chip:hover { color: var(--ink); border-color: #c4b4a6; }
.filter-chip:active { transform: scale(.97); }
.filter-chip.active { color: #fff; border-color: var(--green); background: var(--green); }
.catalog-result { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.catalog-result span { color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.clear-filters {
  padding: 0;
  border: 0;
  color: var(--red);
  background: transparent;
  font-size: 11px;
  font-weight: 850;
}
.clear-filters:hover { text-decoration: underline; }

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(54, 37, 25, 0.05);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 16px 38px rgba(54,37,25,.1); }
.product-card:focus-visible {
  outline: 3px solid rgba(198, 64, 54, .24);
  outline-offset: 3px;
}
.product-image {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--surface-2);
}
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #f7efe6;
  background:
    radial-gradient(circle at 70% 22%, rgba(255,255,255,.14), transparent 27%),
    linear-gradient(145deg, #64705a, #30392b);
}
.product-placeholder span { font-family: Georgia, serif; font-size: 54px; line-height: .9; }
.product-placeholder small { margin-top: 7px; font-size: 9px; font-weight: 850; letter-spacing: .22em; text-transform: uppercase; }
.status-pill {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(25,20,17,.76);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 800;
}
.status-pill.pending { color: #4c3416; background: #f3d9ad; }
.status-pill.low { color: #fff; background: var(--amber); }
.status-pill.soldout { background: var(--red); }
.product-body { padding: 15px; }
.brand-prices {
  margin: -15px -15px 13px;
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--line);
  background: #f8f3ec;
}
.brand-prices > div {
  min-width: 0;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 8px;
}
.brand-prices > div + div { border-left: 1px solid var(--line); }
.price-values {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
}
.price-values strong { color: var(--ink); }
.price-values b { color: var(--red); font-size: 11px; }
.brand-prices small {
  grid-column: 1 / -1;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
}
.brand-prices span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.brand-prices strong { font-size: 13px; white-space: nowrap; }
.product-meta { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.product-category { color: var(--red); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.product-body h3 { margin: 5px 0 3px; font-family: Georgia, serif; font-size: 18px; line-height: 1.12; }
.model-ref { margin: 0; color: var(--muted); font-size: 11px; }
.stock-count { min-width: 58px; padding: 7px 8px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.stock-count strong { display: block; font-size: 20px; line-height: 1; }
.stock-count span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.stock-count small { display: block; margin-top: 3px; color: var(--amber); font-size: 8px; font-weight: 800; }
.size-chips { min-height: 31px; margin: 13px 0 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.size-chip { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.size-chip b { color: var(--ink); }
.size-chip em { color: var(--amber); font-size: 8px; font-style: normal; }
.pending-copy { color: var(--amber); font-size: 12px; font-weight: 750; }
.velocity-note { margin: 0 0 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.card-footer { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.action-button {
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
}
.action-button:hover { background: #e3d8cb; }
.action-button.sale { color: #fff; background: var(--green); }
.action-button.sale:hover { background: #315638; }
.action-button.edit { width: 40px; font-size: 16px; }

.empty-state {
  max-width: 700px;
  margin: 12px auto 0;
  padding: 58px 28px;
  border: 1px dashed #cbbcae;
  border-radius: 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 253, 248, .62);
}
.empty-state .empty-art {
  width: 82px;
  height: 82px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #64705a, #30392b);
  box-shadow: 0 14px 28px rgba(48, 57, 43, .18);
}
.empty-state .empty-art span { font-family: Georgia, serif; font-size: 44px; }
.empty-state .eyebrow { margin-bottom: 9px; }
.empty-state h2 { margin: 0 0 9px; color: var(--ink); font-family: Georgia, serif; font-size: clamp(27px, 4vw, 39px); }
.empty-state p:not(.eyebrow) { max-width: 480px; margin: 0 auto 22px; line-height: 1.6; }
.empty-state button + button { margin-left: 8px; }

.activity-panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading .eyebrow { margin-top: 0; }
.section-heading h2, .section-heading h3 { margin: 0; font-family: Georgia, serif; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.section-heading.compact { margin-bottom: 13px; }
.live-pill { color: var(--green); font-size: 12px; font-weight: 800; }
.activity-list { margin-top: 22px; }
.load-more { margin-top: 18px; }
.activity-toolbar,
.reservation-toolbar {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 210px 170px;
  gap: 10px;
}
.activity-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.activity-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); }
.activity-row strong { display: block; }
.activity-row span, .activity-row time { color: var(--muted); font-size: 12px; }
.activity-row small { display: block; margin-top: 4px; color: var(--green); font-size: 11px; }
.activity-row.reversed { background: #fff8f3; }
.activity-actions { display: grid; justify-items: end; gap: 5px; }
.activity-actions .text-button { color: var(--red); font-size: 11px; }
.activity-actions .audit-note { color: var(--red); font-weight: 800; }

.reservations-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.reservations-header .eyebrow { margin-top: 0; }
.reservations-header h2 { margin: 0; font-family: Georgia, serif; font-size: 32px; }
.reservations-header p:last-child { margin: 7px 0 0; color: var(--muted); }
.reservation-summary {
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.reservation-summary article {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e0c38f;
  border-radius: 16px;
  color: #6c4519;
  background: #fff1d8;
}
.reservation-summary article.ready {
  color: #234b2d;
  border-color: #a7c4ad;
  background: #e4f1e7;
}
.reservation-summary article.payment-pending {
  color: #69384b;
  border-color: #d7aec0;
  background: #f8e7ee;
}
.reservation-summary span { font-weight: 800; }
.reservation-summary strong { font-family: Georgia, serif; font-size: 34px; }
.reservation-list { display: grid; gap: 12px; }
.reservation-toolbar { margin: 0 0 14px; }
.reservation-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 16px;
  background: var(--surface);
}
.reservation-card.ready { border-left-color: var(--green); }
.reservation-card.shipped { border-left-color: #52799c; }
.reservation-card.delivered { opacity: .72; border-left-color: #9c968f; }
.reservation-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.reservation-card h3 { margin: 5px 0 3px; font-family: Georgia, serif; font-size: 24px; }
.reservation-card p { margin: 0; color: var(--muted); }
.reservation-status {
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.reservation-card.ready .reservation-status { color: var(--green); }
.reservation-owner {
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
}
.reservation-details {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 10px;
}
.reservation-details > div {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
.reservation-details span,
.reservation-details strong,
.reservation-details small { display: block; }
.reservation-details span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.reservation-details strong { margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.reservation-details small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.inline-action {
  width: fit-content;
  margin-top: 7px;
  padding: 0;
  border: 0;
  color: var(--red);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.age-alert {
  margin-top: 7px;
  display: inline-block;
  color: #7c4d0e;
  font-size: 11px;
  font-weight: 850;
}
.reservation-history { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.reservation-history summary { color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.reservation-history ol { margin: 12px 0 0; padding-left: 22px; }
.reservation-history li { margin-bottom: 9px; padding-left: 4px; }
.reservation-history b,
.reservation-history span,
.reservation-history small { display: block; }
.reservation-history b { font-size: 12px; }
.reservation-history span,
.reservation-history small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.reservation-card footer { margin-top: 14px; display: flex; justify-content: flex-end; }
.reservation-card footer { flex-wrap: wrap; gap: 8px; }
.payment-status.pending { color: #9c5c16; }
.payment-status.paid { color: var(--green); }

dialog {
  width: min(920px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(25,20,17,.3);
}
dialog::backdrop { background: rgba(25,20,17,.58); backdrop-filter: blur(5px); }
.dialog-card { padding: 26px; overflow: auto; }
.dialog-card > header, .dialog-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dialog-card > header { margin-bottom: 22px; }
.dialog-card > header .eyebrow { margin-top: 0; }
.dialog-card h2 { margin: 0; font-family: Georgia, serif; font-size: 30px; }
.icon-button { width: 40px; height: 40px; color: var(--muted); background: var(--surface-2); font-size: 24px; }
.form-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; }
.image-picker {
  position: relative;
  height: 285px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1.5px dashed #c5b8ab;
  border-radius: 18px;
  background: var(--surface-2);
  cursor: pointer;
}
.image-picker input { position: absolute; opacity: 0; pointer-events: none; }
.image-picker img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.image-picker.has-image img { display: block; }
.image-picker.has-image .image-placeholder { opacity: 0; }
.image-placeholder { display: grid; gap: 4px; text-align: center; color: var(--muted); }
.image-placeholder b { color: var(--red); font-size: 34px; }
.image-placeholder strong { color: var(--ink); }
.image-placeholder small { font-weight: 500; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.sizes-editor { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.size-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 10px; margin-bottom: 9px; }
.remove-size { border: 0; border-radius: 10px; color: var(--red); background: var(--red-soft); font-size: 18px; }
.danger {
  margin-right: auto;
  border: 1px solid #d9aaa5;
  color: var(--red-dark);
  background: #fff5f3;
}
.danger:hover { background: var(--red-soft); }
.confirm-stock { margin-top: 14px; display: inline-flex; align-items: center; gap: 9px; }
.confirm-stock input { width: 17px; height: 17px; accent-color: var(--red); }
.dialog-card > footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.dialog-card > footer > div { display: flex; width: 100%; gap: 9px; }
.small-dialog { max-width: 620px; }
.movement-confirmation {
  margin-top: 18px;
  padding: 15px;
  display: grid;
  gap: 5px;
  border: 1px solid #a7c4ad;
  border-radius: 13px;
  color: #234b2d;
  background: #e4f1e7;
}
.movement-confirmation span,
.movement-confirmation b { font-size: 12px; }

.cart-sale-card { max-width: 860px; }
.cart-mode-button b {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  text-align: center;
}
.cart-mode-button.active { color: #fff; border-color: var(--red); background: var(--red); }
.cart-mode-button.active b { color: var(--red); background: #fff; }
.cart-selected { outline: 3px solid rgba(187, 48, 43, .45); outline-offset: -3px; }
.cart-selected-badge {
  position: absolute;
  right: 7px;
  top: 7px;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  font-size: 10px;
  font-weight: 900;
}
.cart-dock {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 110;
  width: min(520px, calc(100% - 28px));
  min-height: 54px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 14px 38px rgba(26,20,17,.34);
  cursor: pointer;
}
.cart-dock span, .cart-dock strong { font-size: 13px; }
.checkout-rule {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.45;
}
.cart-add-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 1fr) 100px auto;
  align-items: end;
  gap: 10px;
}
.cart-add-row > button { min-height: 46px; }
.cart-items { margin: 20px 0; display: grid; gap: 8px; }
.cart-summary {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  border-radius: 12px;
  color: #234b2d;
  background: #e4f1e7;
}
.cart-item {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cart-item strong,
.cart-item span { display: block; }
.cart-item span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.cart-item .icon-button { flex: 0 0 auto; color: var(--red); }
.empty-state.compact { padding: 28px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.empty-state.compact h3 { margin: 0; }
.empty-state.compact p { margin: 5px 0 0; }

.product-history-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.product-history-list { display: grid; }
.product-history-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.product-history-row:first-child { border-top: 0; }
.history-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--red); }
.product-history-row strong,
.product-history-row p,
.product-history-row small { display: block; }
.product-history-row p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.product-history-row small { margin-top: 3px; color: var(--green); font-size: 10px; }
.product-history-row time { color: var(--muted); font-size: 9px; text-align: right; }

.product-details-dialog { max-width: 880px; }
.product-details-card > header { margin-bottom: 18px; }
.product-details-layout {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr);
  gap: 24px;
}
.details-image {
  min-height: 430px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-2);
}
.details-image img {
  width: 100%;
  height: 100%;
  min-height: 430px;
  display: block;
  object-fit: cover;
}
.details-model {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}
.details-prices {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.details-prices article { padding: 18px; }
.details-prices article + article { border-left: 1px solid var(--line); }
.details-prices span,
.details-stock span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.details-prices strong {
  margin-top: 5px;
  display: block;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 30px;
  line-height: 1;
}
.details-prices b { margin-top: 7px; display: block; font-size: 17px; }
.details-prices small { margin-top: 4px; display: block; color: var(--muted); font-size: 12px; }
.details-stock {
  margin-top: 14px;
  padding: 18px;
  border-radius: 16px;
  color: #fff;
  background: var(--green);
}
.details-stock span,
.details-stock small { color: rgba(255,255,255,.78); }
.details-stock .velocity-note { margin: 8px 0 0; color: rgba(255,255,255,.78); }
.details-stock strong {
  margin: 5px 8px 0 0;
  display: inline-block;
  font-family: Georgia, serif;
  font-size: 46px;
  line-height: 1;
}
.details-stock small { font-size: 13px; font-weight: 700; }
.details-variants {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.details-variants > div {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}
.details-variants span,
.details-variants small { display: block; color: var(--muted); font-size: 10px; }
.details-variants strong { display: block; font-size: 22px; }
.details-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: 13px;
  color: #fff;
  background: #17120f;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red-dark); }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .inventory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    z-index: 120;
    width: 248px;
    transform: translateX(-105%);
    transition: transform .22s;
  }
  .sidebar.open { transform: translateX(0); }
  main { padding: 24px 16px 60px; }
  .mobile-menu { display: inline-flex; align-items: center; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search { grid-column: 1 / -1; }
  .inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-layout { grid-template-columns: 1fr; }
  .image-picker { height: 250px; }
  .product-details-layout { grid-template-columns: 1fr; }
  .reservations-header { align-items: flex-start; }
  .reservation-details { grid-template-columns: 1fr 1fr; }
  .activity-toolbar,
  .reservation-toolbar { grid-template-columns: 1fr 1fr; }
  .activity-toolbar input,
  .reservation-toolbar input { grid-column: 1 / -1; }
  .details-image,
  .details-image img { min-height: 360px; }
  .cart-add-row { grid-template-columns: 1fr 1fr; }
  .cart-add-row > button { width: 100%; }
  .reservation-summary { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 590px) {
  input,
  select {
    font-size: 16px;
  }
  .login-card { padding: 34px 24px; }
  .password-row { display: grid; }
  .topbar { align-items: flex-start; }
  .topbar h1 { max-width: 220px; }
  .sync-copy { width: min(250px, calc(100vw - 20px)); line-height: 1.45; }
  .topbar-actions {
    flex: 0 0 205px;
    max-width: 205px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .topbar:has(#cartSaleButton.hidden) .topbar-actions {
    flex-basis: 50px;
    width: 50px;
    max-width: 50px;
  }
  .topbar:has(#cartSaleButton.hidden) h1 { max-width: none; }
  .stats-grid {
    margin: 18px 0 16px;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .stat-card {
    min-height: 92px;
    padding: 11px 12px;
    border-radius: 13px;
  }
  .stat-card span {
    font-size: 10px;
    line-height: 1.15;
  }
  .stat-card strong {
    margin: 3px 0 1px;
    font-size: 29px;
    line-height: 1;
  }
  .stat-card small {
    display: block;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .inventory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .toolbar, .fields { grid-template-columns: 1fr; }
  .search, .field.wide { grid-column: auto; }
  .catalog-controls { align-items: flex-start; margin: -1px 0 15px; display: grid; gap: 9px; }
  .quick-filters {
    width: calc(100vw - 20px);
    margin-inline: -1px;
    padding: 1px 1px 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .quick-filters::-webkit-scrollbar { display: none; }
  .filter-chip { min-height: 31px; padding-inline: 11px; font-size: 10px; }
  .catalog-result { min-height: 20px; justify-content: space-between; }
  .catalog-result span, .clear-filters { font-size: 10px; }
  .empty-state { margin-top: 8px; padding: 40px 18px; border-radius: 18px; }
  .empty-state .empty-art { width: 68px; height: 68px; margin-bottom: 16px; }
  .empty-state .empty-art span { font-size: 38px; }
  .empty-state h2 { font-size: 28px; }
  .empty-state button { width: 100%; }
  .empty-state button + button { margin: 8px 0 0; }
  .reservations-header { display: grid; padding: 18px; }
  .reservations-header .primary { width: 100%; }
  .reservation-summary { gap: 7px; }
  .reservation-summary article { padding: 13px; display: grid; }
  .reservation-summary span { font-size: 10px; }
  .reservation-summary strong { font-size: 28px; }
  .reservation-summary article { min-width: 0; }
  .reservation-summary span { overflow-wrap: anywhere; }
  .reservation-card { padding: 15px; }
  .reservation-details { grid-template-columns: 1fr; }
  .activity-toolbar,
  .reservation-toolbar { grid-template-columns: 1fr; }
  .activity-toolbar input,
  .reservation-toolbar input { grid-column: auto; }
  .activity-row { grid-template-columns: 34px 1fr; gap: 9px; }
  .activity-actions { grid-column: 2; justify-items: start; }
  .cart-add-row { grid-template-columns: 1fr; }
  .cart-meta { grid-template-columns: 1fr; }
  .cart-summary { display: grid; gap: 3px; }
  .product-history-row { grid-template-columns: 8px 1fr; }
  .product-history-row time { grid-column: 2; text-align: left; }
  main { padding-inline: 10px; }
  .product-card { border-radius: 12px; }
  .product-image { height: 118px; }
  .product-placeholder span { font-size: 35px; }
  .product-placeholder small { margin-top: 4px; font-size: 6px; }
  .status-pill {
    left: 6px;
    top: 6px;
    max-width: calc(100% - 12px);
    padding: 4px 6px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .product-body { padding: 8px; }
  .brand-prices { margin: -8px -8px 7px; }
  .brand-prices { grid-template-columns: 1fr; }
  .brand-prices > div {
    min-width: 0;
    padding: 6px 4px;
    grid-template-columns: auto 1fr;
    justify-items: stretch;
    gap: 2px 4px;
  }
  .brand-prices > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .brand-prices span { font-size: 7px; }
  .price-values {
    justify-self: end;
    gap: 4px;
  }
  .price-values strong, .price-values b {
    max-width: 100%;
    font-size: 8px;
    line-height: 1.15;
    white-space: normal;
  }
  .brand-prices small {
    max-width: 100%;
    font-size: 7px;
    overflow-wrap: anywhere;
  }
  .bcv-rate {
    min-width: 250px;
    margin-top: 7px;
    padding: 8px 10px;
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .bcv-rate strong { font-size: 11px; }
  .bcv-rate time { font-size: 10px; }
  .bcv-rate small { display: none; }
  .product-meta {
    display: grid;
    gap: 6px;
  }
  .product-category, .model-ref { display: none; }
  .product-body h3 {
    min-height: 28px;
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .stock-count {
    min-width: 0;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 7px;
  }
  .stock-count strong { font-size: 13px; }
  .stock-count span {
    margin: 0;
    font-size: 7px;
  }
  .size-chips {
    min-height: 23px;
    max-height: 48px;
    margin: 7px 0;
    overflow: hidden;
    gap: 3px;
  }
  .size-chip {
    padding: 3px 4px;
    border-radius: 5px;
    font-size: 8px;
  }
  .pending-copy {
    font-size: 8px;
    line-height: 1.15;
  }
  .card-footer {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }
  .action-button {
    min-width: 0;
    min-height: 30px;
    padding: 0 3px;
    overflow: hidden;
    font-size: 0;
  }
  .action-button.sale::after {
    content: "Venta";
    font-size: 9px;
  }
  .action-button[data-action="restock"]::after {
    content: "+Stock";
    font-size: 9px;
  }
  .action-button.edit {
    width: auto;
    font-size: 13px;
  }
  .dialog-card { padding: 20px; }
  .dialog-card > footer { align-items: flex-start; flex-direction: column; }
  .dialog-card > footer > div { width: 100%; }
  .dialog-card > footer button { flex: 1; }
  .product-details-card { padding: 16px; }
  .product-details-card h2 { font-size: 25px; }
  .details-image,
  .details-image img { min-height: 280px; max-height: 42vh; }
  .details-prices article { padding: 13px 10px; }
  .details-prices strong { font-size: 25px; }
  .details-prices b { font-size: 14px; }
  .details-prices small { font-size: 10px; overflow-wrap: anywhere; }
  .details-stock { padding: 14px; }
  .details-stock strong { font-size: 38px; }
}

@media (max-width: 450px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 205px;
    align-items: start;
    gap: 0 10px;
  }
  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
    width: 205px;
    max-width: 205px;
    justify-self: end;
  }
  .topbar-copy {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .topbar:has(#cartSaleButton.hidden) {
    grid-template-columns: minmax(0, 1fr) 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  body.pull-refreshing .pull-refresh-icon { animation: none; }
}
