:root {
  color-scheme: dark;

  /* Base OLED */
  --bg: #000000;
  --surface: #070707;
  --surface-2: #101010;
  --surface-3: #191919;
  --border: #2b2b2b;
  --border-soft: #202020;

  /* Tipografía */
  --text: #ffffff;
  --text-soft: #e8e8e8;
  --muted: #a3a3a3;

  /* Identidad neutra: el color queda reservado para estados */
  --primary: #929292;
  --primary-hover: #ababab;
  --primary-soft: rgba(255, 255, 255, 0.065);
  --lime: var(--primary);
  --lime-2: var(--primary-hover);
  --lime-soft: var(--primary-soft);

  /* Colores semánticos */
  --positive: #4ade80;
  --positive-soft: rgba(34, 197, 94, 0.13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);

  /* Componentes */
  --topbar: rgba(0, 0, 0, 0.94);
  --panel-bg: linear-gradient(145deg, #101010, #060606);
  --input-bg: #080808;
  --subtle-bg: rgba(255, 255, 255, 0.025);
  --hover-bg: rgba(255, 255, 255, 0.045);

  --radius: 18px;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
}

:root[data-theme="light"] {
  color-scheme: light;

  /* Gris mate: ninguna superficie es blanco puro */
  --bg: #d7d7d7;
  --surface: #e7e7e7;
  --surface-2: #dcdcdc;
  --surface-3: #cecece;
  --border: #bdbdbd;
  --border-soft: #cdcdcd;

  /* Tipografía */
  --text: #111111;
  --text-soft: #2c2c2c;
  --muted: #626262;

  /* Identidad neutra */
  --primary: #737373;
  --primary-hover: #5e5e5e;
  --primary-soft: rgba(0, 0, 0, 0.055);
  --lime: var(--primary);
  --lime-2: var(--primary-hover);
  --lime-soft: var(--primary-soft);

  /* Colores semánticos */
  --positive: #15803d;
  --positive-soft: rgba(34, 197, 94, 0.12);
  --amber: #a84d08;
  --amber-soft: rgba(251, 191, 36, 0.20);
  --danger: #b91c1c;
  --danger-soft: rgba(248, 113, 113, 0.16);

  /* Componentes */
  --topbar: rgba(215, 215, 215, 0.94);
  --panel-bg: linear-gradient(145deg, #ededed, #dfdfdf);
  --input-bg: #f0f0f0;
  --subtle-bg: rgba(0, 0, 0, 0.028);
  --hover-bg: rgba(0, 0, 0, 0.05);

  --shadow: 0 16px 45px rgba(0, 0, 0, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -20%, rgba(255, 255, 255, 0.035), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.30);
  outline-offset: 2px;
}

:root[data-theme="light"] :focus-visible {
  outline-color: rgba(0, 0, 0, 0.28);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 clamp(18px, 3vw, 46px);
  background: var(--topbar);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 13px; font-size: clamp(18px, 2vw, 25px); font-weight: 750; white-space: nowrap; letter-spacing: -.04em; }
.brand strong, .auth-brand h1 span { color: var(--lime); }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid var(--lime);
  border-radius: 11px;
  color: var(--lime);
  font-size: 25px;
  font-weight: 900;
  transform: rotate(45deg);
  box-shadow: inset 0 0 20px rgba(148, 163, 184, .12);
}
.brand-mark::first-letter { transform: rotate(-45deg); }
.desktop-nav { display: flex; align-self: stretch; align-items: stretch; gap: 4px; margin-left: auto; }
.desktop-nav a { display: grid; place-items: center; padding: 0 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--text); border-bottom-color: var(--lime); }
.top-meta { display: flex; align-items: center; gap: 18px; color: var(--muted); }
.top-meta time { white-space: nowrap; }
.user-menu { position: relative; }
.user-button { display: flex; align-items: center; gap: 9px; padding: 7px 9px; color: var(--text); background: transparent; border: 0; border-radius: 12px; cursor: pointer; }
.user-button:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border: 1px solid rgba(148, 163, 184, .4); border-radius: 50%; font-weight: 800; }
.avatar.large { width: 52px; height: 52px; font-size: 20px; flex: 0 0 auto; }
.user-dropdown { position: absolute; top: calc(100% + 12px); right: 0; width: 240px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); animation: panel-in .18s ease-out; }
.user-dropdown a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--muted); }
.user-dropdown a:hover { color: var(--text); background: var(--surface-3); }
.mobile-menu-button { display: none; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; width: 42px; height: 42px; }
.mobile-nav { position: fixed; z-index: 45; inset: 76px 0 auto; max-height: calc(100vh - 76px); overflow: auto; padding: 12px 18px 22px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); animation: panel-in .2s ease-out; }
.mobile-nav a { display: block; padding: 13px 12px; color: var(--muted); border-radius: 10px; }
.mobile-nav a.active, .mobile-nav a:hover { color: var(--text); background: var(--lime-soft); }

.app-shell { width: min(1580px, calc(100% - clamp(24px, 4vw, 64px))); min-height: calc(100vh - 145px); margin: 0 auto; padding: 30px 0 44px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 2px 0 4px; font-size: clamp(27px, 3vw, 40px); line-height: 1.1; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 !important; color: var(--lime) !important; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.muted { color: var(--muted); }
.lime-text { color: var(--positive) !important; }
.amber-text { color: var(--amber) !important; }
.block { display: block; }

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 22px 16px; }
.panel-header h2, .panel-header h3 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.02em; }
.text-link { color: var(--lime); font-weight: 700; }
.text-link:hover { text-decoration: underline; }

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { color: var(--primary); background: var(--primary-soft); border-color: rgba(148, 163, 184, .32); }
.btn-ghost { color: var(--muted); background: transparent; border-color: var(--border); }
.btn-large { min-height: 50px; padding-inline: 20px; font-size: 16px; }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.full-width { width: 100%; }
.icon-button { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: var(--surface-2); cursor: pointer; }
.icon-button.danger { color: var(--danger); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.metric-card { min-height: 168px; display: flex; align-items: flex-start; gap: 17px; padding: 24px; background: var(--panel-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.metric-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.metric-icon, .summary-icon { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border: 1px solid rgba(148, 163, 184, .42); border-radius: 50%; font-size: 28px; font-weight: 800; }
.warning .metric-icon, .summary-card.warning .summary-icon { color: var(--amber); background: var(--amber-soft); border-color: rgba(255, 193, 22, .52); }
.metric-card p { margin: 5px 0 3px; font-weight: 650; }
.metric-card strong { display: inline-block; margin-top: 4px; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.08; letter-spacing: -.04em; white-space: nowrap; }
.metric-card small { color: var(--muted); }
.metric-note { display: block; margin-top: 21px; color: var(--muted); font-size: 13px; }
.warning .metric-note { color: var(--amber); }

.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: stretch; }
.inventory-panel { min-width: 0; }
.quick-actions { display: grid; gap: 10px; }
.quick-action { min-height: 94px; display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; background: var(--panel-bg); border: 1px solid var(--border); border-radius: 16px; transition: transform .2s ease, border-color .2s ease; }
.quick-action:hover { border-color: var(--primary); transform: translateY(-1px); }
.quick-icon { width: 56px; height: 56px; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 13px; font-size: 28px; font-weight: 850; }
.quick-action.amber .quick-icon { background: var(--amber); }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { font-size: 16px; }
.quick-action small { color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 17px; }
.summary-card { min-height: 145px; display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; padding: 20px; background: var(--panel-bg); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .2s ease, border-color .2s ease; }
.summary-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.summary-card .summary-icon { width: 50px; height: 50px; font-size: 23px; }
.summary-card p { margin: 0; }
.summary-card strong { display: block; margin: 3px 0; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -.04em; }
.summary-card small { color: var(--muted); }
.summary-card a { grid-column: 2; color: var(--lime); font-weight: 700; }

.table-wrap { width: 100%; overflow-x: auto; padding: 0 14px 16px; scrollbar-color: var(--surface-3) var(--surface); }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: 11px 12px; color: var(--text-soft); background: var(--subtle-bg); border-block: 1px solid var(--border); font-size: 12px; text-align: left; white-space: nowrap; }
.data-table th:first-child { border-left: 1px solid var(--border); border-radius: 10px 0 0 0; }
.data-table th:last-child { border-right: 1px solid var(--border); border-radius: 0 10px 0 0; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); color: var(--text-soft); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--hover-bg); }
.data-table small { color: var(--muted); }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.product-cell img, .photo-placeholder { width: 42px; height: 42px; flex: 0 0 auto; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; color: var(--muted); font-size: 20px; }
.product-cell strong, .product-cell small { display: block; }
.photo-placeholder.large { width: 86px; height: 86px; font-size: 36px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; color: var(--positive); background: var(--positive-soft); border: 1px solid color-mix(in srgb, var(--positive) 40%, transparent); border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.status.warning { color: var(--amber); background: var(--amber-soft); border-color: rgba(255,193,22,.28); }
.status.neutral { color: var(--muted); background: rgba(165,171,163,.08); border-color: var(--border); }

.alert { margin-bottom: 16px; padding: 13px 15px; border: 1px solid; border-radius: 11px; }
.alert-success { color: var(--positive); background: var(--positive-soft); border-color: color-mix(in srgb, var(--positive) 40%, transparent); }
.alert-error { color: #ffb2ac; background: var(--danger-soft); border-color: rgba(255,112,102,.34); }
.alert-warning { color: #ffda72; background: var(--amber-soft); border-color: rgba(255,193,22,.34); }
.alert-info { color: var(--text-soft); background: var(--surface-2); border-color: var(--border); }
.empty-state { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.empty-state.compact { min-height: 130px; }
.empty-state h2, .empty-state h3 { margin: 12px 0 3px; }
.empty-state p { margin: 0 0 16px; color: var(--muted); }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border: 1px solid rgba(148,163,184,.35); border-radius: 15px; font-size: 26px; }

.form-panel { margin-bottom: 20px; padding-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 4px 22px; }
label { display: grid; gap: 7px; color: var(--text-soft); font-size: 13px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(148,163,184,.16); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 6px; }
.form-actions form { display: contents; }
.check-row { display: flex; align-items: center; gap: 9px; }
.check-row input, .check-card input { width: 18px; height: 18px; min-height: 0; accent-color: var(--lime); }
.check-card { display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 11px 13px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; }
.check-card strong, .check-card small { display: block; }
.check-card small { color: var(--muted); font-weight: 400; }
.upload-field { padding: 16px; background: var(--input-bg); border: 1px dashed var(--border); border-radius: 12px; }
.upload-field input { padding: 0; border: 0; background: transparent; }
.upload-field span { color: var(--muted); font-size: 12px; }
.current-photo { display: flex; align-items: center; gap: 15px; }
.current-photo img { width: 100px; height: 100px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); }
.form-hint { margin: 10px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.card-grid, .product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.supplier-card, .product-card { padding: 20px; }
.supplier-card.is-inactive, .product-card.is-inactive { opacity: .64; }
.supplier-title { display: flex; align-items: center; gap: 12px; }
.supplier-title h2 { margin: 0; font-size: 20px; }
.supplier-title p { margin: 0; color: var(--muted); }
.supplier-title .status { margin-left: auto; }
.stat-list { margin: 18px 0; }
.stat-list div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.stat-list dt { color: var(--muted); }
.stat-list dd { margin: 0; font-weight: 700; text-align: right; }
.stat-list .total { margin-top: 4px; padding-top: 13px; font-size: 16px; }
.stat-list.compact { margin: 10px 0; }
.stat-list.compact div { padding: 6px 0; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.card-actions form { display: contents; }
.product-card { display: flex; flex-direction: column; }
.product-photo { height: 180px; position: relative; display: grid; place-items: center; overflow: hidden; margin: -8px -8px 15px; background: var(--input-bg); border: 1px solid var(--border-soft); border-radius: 14px; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-photo .status { position: absolute; top: 10px; right: 10px; backdrop-filter: blur(8px); }
.product-info h2 { margin: 4px 0 3px; font-size: 20px; }
.product-info p { margin: 0; color: var(--muted); }
.product-info { flex: 1; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px; margin-bottom: 16px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; }
.search-field input { border: 0; padding-inline: 0; background: transparent; box-shadow: none; }

.line-editor { margin: 22px; border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.line-editor-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; background: rgba(255,255,255,.018); border-bottom: 1px solid var(--border); }
.line-editor-header h3 { margin: 0; }
.receipt-line { display: grid; grid-template-columns: 2fr .7fr 1fr 1fr auto; align-items: end; gap: 10px; padding: 13px; border-bottom: 1px solid var(--border-soft); }
.receipt-line:last-child { border: 0; }
.form-panel > form > .form-actions { padding: 0 22px; }

.sale-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(390px, .75fr); gap: 15px; align-items: start; margin-bottom: 20px; }
.sale-catalog, .sale-cart { min-width: 0; }
.sale-search { margin: 0 20px 14px; width: calc(100% - 40px); }
.sale-product-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 20px 20px; max-height: 640px; overflow: auto; }
.sale-product { min-width: 0; display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 11px; padding: 10px; color: var(--text); text-align: left; background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.sale-product:hover { border-color: var(--lime-2); background: var(--lime-soft); }
.sale-product img, .sale-product .photo-placeholder { width: 50px; height: 50px; object-fit: cover; border-radius: 9px; }
.sale-product span { min-width: 0; }
.sale-product strong, .sale-product small, .sale-product b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-product small { color: var(--muted); }
.sale-product b { color: var(--lime); margin-top: 2px; }
.stock-chip { align-self: start; padding: 3px 6px; color: var(--muted); background: var(--surface-2); border-radius: 6px; font-size: 11px; white-space: nowrap; }
.sale-cart { position: sticky; top: 92px; padding-bottom: 20px; }
.cart-count { color: var(--muted); font-size: 12px; }
.cart-empty { min-height: 180px; display: grid; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.cart-empty span { color: var(--lime); font-size: 35px; }
.cart-empty h3 { margin: 7px 0 0; color: var(--text); }
.cart-empty p { margin: 2px 0; }
.cart-lines { padding: 0 17px; max-height: 330px; overflow: auto; }
.cart-line { display: grid; grid-template-columns: minmax(110px, 1fr) 70px 100px auto auto; gap: 8px; align-items: end; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.cart-line-title strong, .cart-line-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-title small { color: var(--muted); }
.cart-line label { font-size: 10px; }
.cart-line input { min-height: 37px; padding: 7px; }
.cart-line-total { align-self: center; white-space: nowrap; }
.sale-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 17px 0; }
.sale-totals { margin: 16px 17px; }
.sale-totals div { display: flex; justify-content: space-between; padding: 5px 0; color: var(--muted); }
.sale-totals dd { margin: 0; color: var(--text); font-weight: 700; }
.sale-totals .total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text); font-size: 19px; }
.sale-cart > .btn, .sale-cart > .form-hint { margin-inline: 17px; width: calc(100% - 34px); }

.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.segmented { display: inline-flex; gap: 5px; margin: 0 22px 18px; padding: 4px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 11px; }
.segmented a { padding: 8px 13px; color: var(--muted); border-radius: 8px; font-weight: 700; }
.segmented a.active { color: #fff; background: var(--primary); }
.activity-list { padding: 0 17px 17px; }
.activity-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.activity-item:last-child { border: 0; }
.activity-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border: 1px solid rgba(148,163,184,.3); border-radius: 11px; font-weight: 800; }
.activity-icon.amber { color: var(--amber); background: var(--amber-soft); border-color: rgba(255,193,22,.3); }
.activity-item strong, .activity-item small { display: block; }
.activity-item small { color: var(--muted); }
.activity-value { text-align: right; }
.mini-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 11px; margin-bottom: 17px; }
.mini-metrics article { padding: 17px; background: var(--panel-bg); border: 1px solid var(--border); border-radius: 14px; }
.mini-metrics p { margin: 0; color: var(--muted); }
.mini-metrics strong { display: block; margin-top: 4px; font-size: clamp(20px,2vw,27px); letter-spacing: -.03em; }

.settlement-sheet { padding-bottom: 22px; margin-bottom: 20px; }
.settlement-header { display: flex; justify-content: space-between; gap: 20px; padding: 25px; border-bottom: 1px solid var(--border); }
.settlement-header h2 { margin: 3px 0; font-size: 28px; }
.settlement-header p { margin: 0; color: var(--muted); }
.settlement-state { display: flex; align-items: flex-start; gap: 10px; }
.settlement-sheet .mini-metrics { padding: 18px; margin: 0; }
.settlement-notes { margin: 0 22px 18px; padding: 15px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 11px; }
.settlement-notes p { margin: 4px 0; }
.settlement-notes small { color: var(--muted); }
.settlement-sheet > .form-actions { padding: 0 22px; flex-wrap: wrap; }
.settlement-sheet > .form-actions form { display: contents; }

.filter-panel { padding: 15px; margin-bottom: 16px; }
.filter-grid { display: grid; grid-template-columns: repeat(4,minmax(130px,1fr)); gap: 11px; align-items: end; }
.compact-filters { grid-template-columns: repeat(5,minmax(130px,1fr)); }
.report-metrics { grid-template-columns: repeat(4,1fr); }
.reports-columns { margin-bottom: 15px; }
.audit-timeline { padding: 5px 22px 22px; }
.audit-event { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 10px; }
.audit-event:not(:last-child)::before { content:""; position:absolute; left: 6px; top: 20px; bottom: -5px; width: 1px; background: var(--border); }
.audit-dot { width: 13px; height: 13px; margin-top: 18px; background: var(--primary); border: 3px solid var(--surface); border-radius: 50%; z-index: 1; }
.audit-main { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border-soft); }
.audit-main strong, .audit-main small { display: block; }
.audit-main small { color: var(--muted); }
.audit-main details { text-align: right; }
.audit-main summary { color: var(--lime); cursor: pointer; }
.audit-main pre { max-width: 520px; white-space: pre-wrap; color: var(--muted); text-align: left; }
.settings-columns { margin-bottom: 16px; }
.system-card { display: grid; grid-template-columns: .6fr 1fr; gap: 30px; padding: 22px; }
.system-card .stat-list { margin: 0; }
.system-card > p { grid-column: 1/-1; }

.footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 58px; padding: 0 clamp(18px,3vw,46px); color: #7f857d; border-top: 1px solid var(--border-soft); font-size: 12px; }
.online-dot { display: inline-block; width: 8px; height: 8px; margin-inline: 3px; background: var(--positive); border-radius: 50%; }
.mobile-sale-fab { display: none; }
code { color: var(--lime); }

.auth-body { display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 20% 20%,rgba(148,163,184,.12),transparent 28rem),var(--bg); }
.auth-shell { width: min(980px,100%); display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; align-items: center; }
.login-shell { width: min(900px,100%); }
.auth-brand { display: flex; align-items: flex-start; gap: 18px; }
.auth-brand .brand-mark { width: 56px; height: 56px; flex: 0 0 auto; }
.auth-brand h1 { margin: 5px 0 10px; font-size: clamp(34px,5vw,56px); line-height: .98; letter-spacing: -.055em; }
.auth-brand > div > p:last-child { color: var(--muted); font-size: 17px; }
.auth-card { padding: 28px; background: var(--panel-bg); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.auth-card h2 { margin: 5px 0; font-size: 27px; }
.auth-card > .muted { margin: 0 0 18px; }
.auth-card .form-grid { padding: 10px 0 0; }
.step-pill { display: inline-flex; padding: 5px 9px; color: var(--primary); background: var(--primary-soft); border: 1px solid rgba(148,163,184,.25); border-radius: 999px; font-size: 11px; font-weight: 800; }

.theme-toggle {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.auth-theme-toggle { position: fixed; z-index: 10; top: 20px; right: 20px; }

.field-with-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.inline-filter { display: flex; align-items: end; justify-content: flex-end; gap: 9px; padding: 0 22px 15px; }
.inline-filter label { min-width: min(300px, 100%); }
.compact-label { grid-template-columns: auto minmax(150px, 220px); align-items: center; }
.client-toolbar { align-items: end; }

.client-profile { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px; margin-bottom: 16px; }
.client-profile-main { min-width: 0; display: flex; align-items: center; gap: 15px; }
.client-profile-main h2 { margin: 0; font-size: 26px; }
.client-profile-main p { margin: 3px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.profile-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.client-profile-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.client-profile-actions form { display: contents; }
.client-notes { padding: 20px 22px; margin-bottom: 16px; }
.client-notes > p:last-child { margin-bottom: 0; overflow-wrap: anywhere; }

.app-dialog {
  position: fixed;
  z-index: 80;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 0 0 22px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.app-dialog[open] { animation: dialog-in .2s ease-out; }
.app-dialog::backdrop { background: rgba(2, 6, 23, .72); backdrop-filter: blur(3px); }
.dialog-card { margin: 0; }

.receipt-sheet { padding-bottom: 22px; margin-bottom: 20px; }
.receipt-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px; border-bottom: 1px solid var(--border); }
.receipt-header h2 { margin: 3px 0; font-size: 30px; }
.receipt-header p { margin: 0; color: var(--muted); }
.receipt-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 9px; text-align: right; }
.receipt-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 20px 24px; }
.receipt-parties > div { padding: 14px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px; }
.receipt-parties span, .receipt-parties strong, .receipt-parties small { display: block; }
.receipt-parties span, .receipt-parties small { color: var(--muted); }
.receipt-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .45fr); align-items: start; gap: 25px; padding: 0 24px; }
.receipt-bottom > p { color: var(--muted); overflow-wrap: anywhere; }
.receipt-totals { margin: 0; }
.receipt-sheet > .form-actions { padding: 5px 24px 0; }


.fiscal-receipt-sheet { max-width: 920px; margin-inline: auto; }
.fiscal-receipt-header { padding-bottom: 18px; }
.fiscal-ticket {
  width: min(100%, 760px);
  margin: 0 auto 6px;
  padding: 26px 24px;
  color: #101418;
  background: linear-gradient(180deg, #ffffff, #f6f7f9);
  border: 1px solid #d7dce3;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .18);
}
.ticket-head {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  text-align: center;
  border-bottom: 1px dashed #b8c0cc;
}
.ticket-head small,
.ticket-foot small,
.ticket-line-main small,
.ticket-meta-grid span { color: #667085; }
.ticket-head strong { font-size: 20px; letter-spacing: .12em; }
.ticket-head span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 800; }
.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px dashed #b8c0cc;
}
.ticket-meta-grid div,
.ticket-meta-grid span,
.ticket-meta-grid strong { display: block; }
.ticket-meta-grid strong,
.ticket-lines,
.ticket-totals { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ticket-lines { display: grid; gap: 14px; }
.ticket-line-item { padding-bottom: 14px; border-bottom: 1px dashed #c6ccd6; }
.ticket-line-item:last-child { padding-bottom: 0; border-bottom: 0; }
.ticket-line-main,
.ticket-line-sub,
.ticket-totals div {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}
.ticket-line-main strong:last-child,
.ticket-totals dd { white-space: nowrap; }
.ticket-line-sub { margin-top: 5px; color: #475467; font-size: 13px; }
.ticket-totals {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px dashed #b8c0cc;
}
.ticket-totals dt,
.ticket-totals dd { margin: 0; }
.ticket-totals div { padding: 5px 0; }
.ticket-totals .grand-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px solid #101418;
  font-size: 22px;
  font-weight: 900;
}
.ticket-foot {
  margin-top: 18px;
  padding-top: 16px;
  text-align: center;
  border-top: 1px dashed #b8c0cc;
}
.ticket-foot p { margin: 0 0 8px; color: #475467; }

.btn.is-loading { opacity: .72; cursor: wait; transform: none; }
.panel { animation: panel-in .22s ease-out both; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dialog-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 5px)); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@media (max-width: 1180px) {
  .desktop-nav { display: none; }
  .top-meta { margin-left: auto; }
  .metric-grid, .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .card-grid, .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sale-layout { grid-template-columns: 1fr; }
  .sale-cart { position: static; }
}

@media (max-width: 760px) {
  body { font-size: 14px; padding-bottom: 74px; }
  .topbar { height: 66px; padding: 0 14px; gap: 10px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 35px; height: 35px; font-size: 21px; }
  .top-meta time, .user-menu { display: none; }
  .top-meta { gap: 8px; }
  .mobile-menu-button { display: grid; place-items: center; }
  .mobile-nav { inset-block-start: 66px; }
  .app-shell { width: calc(100% - 24px); padding-top: 20px; }
  .page-heading { align-items: flex-start; margin-bottom: 17px; }
  .page-heading { flex-direction: column; }
  .page-heading > .btn { display: inline-flex; align-self: flex-start; }
  .dashboard-heading > .btn { display: none; }
  .page-heading h1 { font-size: 29px; }
  .metric-grid, .summary-grid, .card-grid, .product-grid, .two-column, .auth-shell { grid-template-columns: 1fr; }
  .metric-card { min-height: 128px; padding: 18px; }
  .metric-card strong { font-size: 29px; }
  .metric-icon { width: 50px; height: 50px; }
  .metric-note { margin-top: 13px; }
  .quick-actions { grid-template-columns: 1fr; }
  .quick-action { min-height: 82px; }
  .summary-card { min-height: 118px; }
  .summary-grid { margin-top: 14px; }
  .panel-header { padding: 17px 16px 13px; }
  .inventory-table { min-width: 0; }
  .inventory-table thead { display: none; }
  .inventory-table tbody { display: grid; gap: 10px; }
  .inventory-table tr { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px 15px; padding: 13px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px; }
  .inventory-table td { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border: 0; }
  .inventory-table td::before { content: attr(data-label); color: var(--muted); }
  .inventory-table td:first-child { grid-column: 1/-1; display: block; padding-bottom: 9px; border-bottom: 1px solid var(--border-soft); }
  .inventory-table td:first-child::before { display: none; }
  .table-wrap { padding-inline: 10px; }
  .responsive-table { min-width: 0; }
  .responsive-table thead { display: none; }
  .responsive-table tbody { display: grid; gap: 10px; }
  .responsive-table tr { display: grid; gap: 6px; padding: 13px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px; }
  .responsive-table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); text-align: left; }
  .responsive-table td > * { max-width: 68%; overflow-wrap: anywhere; }
  .form-grid, .sale-fields { grid-template-columns: 1fr; padding-inline: 16px; }
  .span-2 { grid-column: span 1; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1; }
  .btn { min-height: 46px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .search-field { flex: 1 0 100%; }
  .product-photo { height: 220px; }
  .receipt-line { grid-template-columns: 1fr 1fr; }
  .receipt-line label:first-child { grid-column: 1/-1; }
  .receipt-line .icon-button { grid-column: 2; justify-self: end; }
  .line-editor { margin-inline: 12px; }
  .line-editor-header { align-items: flex-start; }
  .sale-product-list { grid-template-columns: 1fr; padding-inline: 12px; max-height: 450px; }
  .sale-search { margin-inline: 12px; width: calc(100% - 24px); }
  .cart-line { grid-template-columns: 1fr 72px 1fr auto; }
  .cart-line-title { grid-column: 1/-1; }
  .cart-line-total { text-align: right; }
  .activity-item { grid-template-columns: 38px minmax(0,1fr); }
  .activity-value { grid-column: 2; text-align: left; }
  .filter-grid, .compact-filters, .report-metrics { grid-template-columns: 1fr 1fr; }
  .filter-grid .btn { grid-column: 1/-1; }
  .settlement-header { padding: 18px; }
  .settlement-state { flex-direction: column; align-items: flex-end; }
  .audit-main { display: block; }
  .audit-main details { margin-top: 7px; text-align: left; }
  .system-card { grid-template-columns: 1fr; }
  .system-card > p { grid-column: auto; }
  .auth-body { padding: 18px; }
  .auth-brand { padding: 16px 0; }
  .auth-brand .brand-mark { display: none; }
  .auth-brand h1 { font-size: 39px; }
  .auth-card { padding: 20px; }
  .auth-theme-toggle { top: 12px; right: 12px; }
  .field-with-action { grid-template-columns: 1fr; }
  .inline-filter { align-items: stretch; flex-direction: column; padding-inline: 16px; }
  .inline-filter label { min-width: 0; }
  .compact-label { grid-template-columns: 1fr; }
  .client-profile { align-items: stretch; flex-direction: column; padding: 18px; }
  .client-profile-actions { justify-content: flex-start; }
  .client-profile-actions .btn, .client-profile-actions form { flex: 1 1 auto; }
    .receipt-header, .receipt-bottom { grid-template-columns: 1fr; flex-direction: column; padding: 18px; }
  .ticket-meta-grid { grid-template-columns: 1fr; }
  .ticket-line-main, .ticket-line-sub, .ticket-totals div { flex-direction: column; align-items: flex-start; }
  .ticket-line-main strong:last-child, .ticket-totals dd { white-space: normal; }
  .receipt-meta { align-items: flex-start; text-align: left; }
  .receipt-parties { grid-template-columns: 1fr; padding: 16px; }
  .receipt-bottom { display: grid; }
  .receipt-sheet > .form-actions { padding-inline: 16px; }
  .app-dialog { overflow-y: auto; }
  .footer { display: none; }
  .mobile-sale-fab { position: fixed; z-index: 35; left: 12px; right: 12px; bottom: 10px; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; background: var(--primary); border-radius: 14px; font-weight: 850; box-shadow: 0 12px 30px rgba(15,23,42,.34); }
  .mobile-sale-fab span { font-size: 22px; }
}

@media (max-width: 420px) {
  .brand { min-width: 0; }
  .brand span:last-child { max-width: 115px; overflow: hidden; text-overflow: ellipsis; }
  .metric-grid, .summary-grid, .filter-grid, .compact-filters, .report-metrics { grid-template-columns: 1fr; }
  .metric-card { min-height: 116px; }
  .quick-icon { width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  @page { size: 80mm auto; margin: 6mm; }
  body { color: #111; background: #fff; padding: 0; }
  .topbar, .footer, .mobile-sale-fab, .no-print, .alert, .page-heading { display: none !important; }
  .app-shell { width: 100%; padding: 0; }
  .panel, .mini-metrics article { color: #111; background: #fff; border-color: #bbb; box-shadow: none; }
  .settlement-sheet { border: 0; }
  .settlement-header, .data-table td, .data-table th { border-color: #bbb; }
  .data-table { min-width: 0; font-size: 10px; }
  .data-table th, .data-table td { color: #111; padding: 5px; }
  .muted, .settlement-header p, .settlement-notes small, .mini-metrics p { color: #555; }
  .lime-text, .amber-text, .eyebrow { color: #111 !important; }
  .status { color: #111; border-color: #777; background: #fff; }
  .receipt-sheet, .fiscal-receipt-sheet { border: 0; max-width: none; margin: 0; padding: 0; }
  .receipt-header { padding: 0 0 10px; border-bottom: 1px solid #bbb; }
  .receipt-header h2 { font-size: 16px; }
  .receipt-header p, .receipt-meta strong { font-size: 11px; }
  .fiscal-ticket {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    color: #111;
  }
  .ticket-head { margin-bottom: 8px; padding-bottom: 8px; }
  .ticket-head strong,
  .ticket-head span { font-size: 12px; }
  .ticket-meta-grid { grid-template-columns: 1fr; gap: 6px; margin-bottom: 8px; padding-bottom: 8px; }
  .ticket-meta-grid,
  .ticket-line-item,
  .ticket-totals,
  .ticket-foot { border-color: #999; }
  .ticket-line-main,
  .ticket-line-sub,
  .ticket-totals div { font-size: 11px; }
  .ticket-totals .grand-total { font-size: 14px; }
  .ticket-foot p,
  .ticket-foot small,
  .ticket-line-main small,
  .ticket-meta-grid span { font-size: 10px; color: #555; }
}

/* Catálogo público: comparte variables, tipografía y controles con el panel. */
.store-body {
  min-width: 320px;
  color: var(--text);
  background: #f8fafc;
}
.store-body.cart-is-open { overflow: hidden; }
.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--primary);
  border-radius: 9px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.store-shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.store-narrow { max-width: 820px; }
.store-header {
  position: sticky;
  z-index: 50;
  top: 0;
  color: var(--text);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--border-soft);
}
.store-header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.store-brand { min-width: 0; display: inline-flex; align-items: center; gap: 11px; font-size: 19px; font-weight: 800; letter-spacing: -.025em; }
.store-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-brand-mark { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 10px; font-size: 22px; }
.store-nav { display: flex; align-items: center; gap: 18px; color: var(--muted); font-weight: 700; }
.store-nav a:hover { color: var(--primary); }
.store-cart-trigger {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 14px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}
.store-cart-trigger span { min-width: 27px; height: 27px; display: grid; place-items: center; padding-inline: 6px; color: #fff; background: var(--primary); border-radius: 999px; font-size: 12px; }
.store-hero { position: relative; overflow: hidden; padding: clamp(58px,9vw,104px) 0; color: #fff; background: linear-gradient(135deg,#23272f,#4b5563); }
.store-hero::after { content: ""; position: absolute; right: -130px; bottom: -230px; width: 430px; height: 430px; border: 70px solid rgba(255,255,255,.08); border-radius: 50%; pointer-events: none; }
.store-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 40px; }
.store-hero .eyebrow { color: #d1d5db !important; }
.store-hero h1 { max-width: 780px; margin: 7px 0 14px; font-size: clamp(42px,7vw,78px); line-height: .98; letter-spacing: -.055em; }
.store-hero p:not(.eyebrow) { max-width: 650px; margin: 0 0 28px; color: #e5e7eb; font-size: clamp(17px,2vw,21px); }
.store-hero .btn { color: var(--primary); background: #fff; box-shadow: none; }
.store-hero-stat { min-width: 170px; display: grid; gap: 2px; padding: 20px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: 16px; }
.store-hero-stat strong { font-size: 44px; line-height: 1; }
.store-hero-stat span { color: #e5e7eb; }
.store-section { padding: clamp(58px,7vw,86px) 0; background: #fff; }
.store-catalog-section { background: #f8fafc; border-top: 1px solid var(--border-soft); }
.store-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.store-section-heading h2 { margin: 4px 0 0; font-size: clamp(29px,4vw,44px); letter-spacing: -.045em; }
.store-section-heading > p { margin: 0; color: var(--muted); }
.store-featured { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px,32%); gap: 18px; overflow-x: auto; padding: 2px 2px 14px; scroll-snap-type: x mandatory; }
.store-product-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.store-product-card { min-width: 0; overflow: hidden; color: var(--text); background: #fff; border: 1px solid var(--border-soft); border-radius: 16px; scroll-snap-align: start; transition: transform .18s ease,border-color .18s ease; }
.store-product-card:hover { transform: translateY(-2px); border-color: #cbd5e1; }
.store-product-image { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: #eff6ff; }
.store-product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.store-product-card:hover .store-product-image img { transform: scale(1.02); }
.store-product-image > span { position: absolute; top: 12px; left: 12px; padding: 5px 9px; color: #374151; background: #e5e7eb; border: 1px solid #cbd5e1; border-radius: 999px; font-size: 11px; font-weight: 850; }
.store-product-copy { padding: 17px; }
.store-category { margin: 0 0 5px; color: var(--primary); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.store-product-copy h3 { min-height: 2.5em; margin: 0 0 6px; font-size: 18px; line-height: 1.2; }
.store-product-copy > p:not(.store-category,.store-stock) { min-height: 3em; margin: 0 0 13px; color: var(--muted); font-size: 13px; }
.store-price { min-height: 31px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.store-price strong { font-size: 20px; }
.store-price del { color: var(--muted); font-size: 13px; }
.store-stock { margin: 7px 0 13px; font-size: 12px; font-weight: 750; }
.store-stock.available { color: var(--positive); }
.store-stock.unavailable { color: var(--danger); }
.store-product-actions { display: grid; grid-template-columns: 62px 1fr; gap: 8px; }
.store-product-actions input { min-height: 42px; padding: 7px; text-align: center; }
.store-product-actions .btn { min-width: 0; padding-inline: 10px; }
.store-tools { display: grid; grid-template-columns: minmax(0,1fr) 270px; gap: 12px; margin-bottom: 24px; }
.store-tools label { display: block; }
.store-search { position: relative; }
.store-search span { position: absolute; top: 50%; left: 14px; color: var(--muted); transform: translateY(-50%); }
.store-search input { padding-left: 42px; }
.store-empty { min-height: 300px; display: grid; place-content: center; justify-items: center; padding: 35px; color: var(--muted); background: #fff; border: 1px dashed var(--border); border-radius: 16px; text-align: center; }
.store-empty > span { color: var(--primary); font-size: 48px; }
.store-empty h3 { margin: 10px 0 4px; color: var(--text); font-size: 23px; }
.store-empty p { margin: 0; }
.store-footer { padding: 30px 0; color: var(--muted); background: #fff; border-top: 1px solid var(--border-soft); }
.store-footer .store-shell { display: flex; justify-content: space-between; gap: 18px; }
.store-footer p { margin: 0; }
.store-cart-overlay { position: fixed; z-index: 70; inset: 0; background: rgba(15,23,42,.48); opacity: 0; transition: opacity .18s ease; }
.store-cart-overlay.is-visible { opacity: 1; }
.store-cart { position: fixed; z-index: 75; top: 0; right: 0; bottom: 0; width: min(440px,100%); display: flex; flex-direction: column; padding: 24px; color: var(--text); background: #fff; border-left: 1px solid var(--border); transform: translateX(105%); transition: transform .2s ease; }
.store-cart.is-open { transform: translateX(0); }
.store-cart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--border-soft); }
.store-cart-head h2 { margin: 2px 0 0; }
.store-cart-message { min-height: 24px; padding-top: 7px; color: var(--positive); font-size: 13px; }
.store-cart-message.is-error { color: var(--danger); }
.store-cart-items { flex: 1; overflow-y: auto; }
.store-cart-empty { flex: 1; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.store-cart-empty > span { color: var(--primary); font-size: 44px; }
.store-cart-empty p { margin: 8px 0 2px; color: var(--text); font-weight: 800; }
.store-cart-item { display: grid; grid-template-columns: 66px minmax(0,1fr) auto; gap: 11px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.store-cart-item img { width: 66px; height: 66px; object-fit: cover; background: #eff6ff; border-radius: 9px; }
.store-cart-item a { display: block; font-weight: 800; line-height: 1.25; }
.store-cart-item small { display: block; margin-top: 3px; color: var(--muted); }
.store-cart-item > strong { white-space: nowrap; font-size: 13px; }
.store-cart-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.store-cart-controls input { width: 58px; min-height: 33px; padding: 4px; text-align: center; }
.store-text-button { padding: 4px; color: var(--muted); background: transparent; border: 0; text-decoration: underline; cursor: pointer; }
.store-text-button.danger { color: var(--danger); }
.store-cart-summary { padding-top: 16px; border-top: 1px solid var(--border); }
.store-cart-summary > div { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.store-cart-summary strong { font-size: 25px; }
.store-cart-summary > .store-text-button { display: block; margin: 8px auto 0; }
.store-detail { padding: 38px 0 86px; background: #f8fafc; }
.store-breadcrumbs { display: flex; gap: 8px; margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.store-breadcrumbs a { color: var(--primary); }
.store-detail-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(340px,.95fr); gap: 48px; align-items: start; }
.store-detail-image { overflow: hidden; background: #eff6ff; border: 1px solid var(--border-soft); border-radius: 18px; }
.store-detail-image img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.store-detail-copy { position: sticky; top: 98px; padding: 8px 0; }
.store-detail-copy h1 { margin: 6px 0 4px; font-size: clamp(34px,5vw,57px); line-height: 1; letter-spacing: -.055em; }
.store-sku { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.store-detail-lead { color: var(--text-soft); font-size: 18px; }
.store-detail-price { display: flex; align-items: baseline; gap: 12px; margin: 22px 0 4px; }
.store-detail-price strong { font-size: 34px; }
.store-detail-price del { color: var(--muted); }
.store-detail-actions { display: grid; grid-template-columns: 120px 1fr; align-items: end; gap: 10px; margin: 22px 0 30px; }
.store-description { padding-top: 23px; border-top: 1px solid var(--border); }
.store-description h2 { margin: 0 0 9px; }
.store-description p { color: var(--text-soft); }
.store-not-found,.store-cart-page { min-height: calc(100vh - 160px); display: grid; align-items: center; padding: 65px 0; background: #f8fafc; }
.store-not-found h1,.store-cart-page h1 { margin: 6px 0 10px; font-size: clamp(35px,5vw,58px); letter-spacing: -.05em; }
.store-not-found p,.store-cart-page > .store-shell > p { color: var(--muted); }
.store-cart-page-card { margin-top: 26px; padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 17px; }
.store-cart-page-empty { min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 14px; }
.store-cart-page-empty p { margin: 0; color: var(--muted); }
.store-cart-page-summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 18px; padding-top: 20px; margin-top: 12px; border-top: 1px solid var(--border); }
.store-cart-page-summary strong { font-size: 29px; text-align: right; }
.store-cart-page-summary .btn { grid-column: 1/-1; }
.store-cart-item.page { grid-template-columns: 78px minmax(0,1fr) auto; }
.status.featured { color: var(--primary); background: var(--primary-soft); border-color: #cbd5e1; }
.compact-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }

@media (max-width: 980px) {
  .store-product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .store-detail-grid { gap: 28px; }
}
@media (max-width: 760px) {
  .store-body { padding-bottom: 0; font-size: 15px; }
  .store-shell { width: min(100% - 24px,1180px); }
  .store-nav > a { display: none; }
  .store-hero-grid { grid-template-columns: 1fr; }
  .store-hero-stat { min-width: 0; grid-template-columns: auto 1fr; align-items: center; justify-self: start; }
  .store-featured { grid-auto-columns: minmax(255px,82%); }
  .store-product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .store-tools { grid-template-columns: 1fr; }
  .store-detail-grid { grid-template-columns: 1fr; }
  .store-detail-copy { position: static; }
  .store-footer { display: block; }
  .store-footer .store-shell { flex-direction: column; }
}
@media (max-width: 520px) {
  .store-brand { max-width: 55vw; font-size: 16px; }
  .store-brand-mark { width: 32px; height: 32px; }
  .store-cart-trigger { padding-left: 10px; font-size: 13px; }
  .store-product-grid { grid-template-columns: 1fr; }
  .store-product-copy h3,.store-product-copy > p:not(.store-category,.store-stock) { min-height: 0; }
  .store-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .store-detail-actions { grid-template-columns: 1fr; }
  .store-cart { top: auto; left: 0; width: 100%; max-height: 88vh; padding: 18px; border: 0; border-radius: 18px 18px 0 0; transform: translateY(105%); }
  .store-cart.is-open { transform: translateY(0); }
  .store-cart-item,.store-cart-item.page { grid-template-columns: 60px minmax(0,1fr); }
  .store-cart-item > strong { grid-column: 2; }
  .store-cart-page-card { padding: 16px; }
}

/* Ajustes comerciales 1.1.1: catálogo más compacto y carrito con cierre claro. */
.store-hero {
  padding: clamp(44px,6vw,76px) 0;
  background:
    radial-gradient(circle at 82% 20%,rgba(203,213,225,.20),transparent 28%),
    linear-gradient(135deg,#111827 0%,#374151 62%,#4b5563 100%);
}
.store-hero::after { right: -180px; bottom: -290px; width: 520px; height: 520px; border-width: 82px; }
.store-hero-grid { grid-template-columns: minmax(0,1.35fr) minmax(250px,.65fr); align-items: center; }
.store-hero h1 { max-width: 760px; font-size: clamp(40px,5.5vw,68px); }
.store-hero-copy > p:not(.eyebrow) { max-width: 720px; }
.store-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.store-hero-cart-link { min-height: 46px; padding: 0 4px; color: #fff; background: transparent; border: 0; font-weight: 800; cursor: pointer; }
.store-hero-cart-link span { min-width: 25px; height: 25px; display: inline-grid; place-items: center; margin-left: 5px; color: #374151; background: #fff; border-radius: 999px; font-size: 12px; }
.store-trust-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.store-trust-row span { padding: 7px 10px; color: #e5e7eb; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; font-size: 12px; font-weight: 750; }
.store-hero-summary { display: grid; gap: 5px; padding: 25px; background: rgba(17,24,39,.42); border: 1px solid rgba(255,255,255,.22); border-radius: 20px; backdrop-filter: blur(8px); box-shadow: 0 24px 55px rgba(3,7,18,.18); }
.store-hero-summary p { margin: 0 !important; color: #d1d5db !important; font-size: 13px !important; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.store-hero-summary strong { font-size: clamp(48px,7vw,72px); line-height: .95; letter-spacing: -.06em; }
.store-hero-summary span { color: #e5e7eb; }
.store-hero-summary a { margin-top: 16px; color: #fff; font-weight: 850; }
.store-catalog-section { padding-top: clamp(42px,5vw,64px); }
.store-product-card { border-radius: 20px; box-shadow: 0 10px 30px rgba(15,23,42,.045); }
.store-product-copy { padding: 18px; }
.store-product-actions .btn { font-weight: 850; }
.store-cart { box-shadow: -25px 0 70px rgba(15,23,42,.16); }
.store-cart-summary .btn { min-height: 48px; }

.store-cart-page { display: block; min-height: calc(100vh - 130px); padding: clamp(42px,6vw,72px) 0; }
.store-cart-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.store-cart-page-heading h1 { margin-bottom: 8px; }
.store-cart-page-heading p { max-width: 720px; margin: 0; color: var(--muted); }
.store-back-link { color: var(--primary); font-weight: 800; white-space: nowrap; }
.store-cart-page-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; align-items: start; }
.store-cart-page-card { min-height: 310px; margin: 0; padding: 24px; box-shadow: 0 15px 40px rgba(15,23,42,.05); }
.store-cart-page-empty > span { color: var(--primary); font-size: 48px; }
.store-cart-page-empty small { color: var(--muted); }
.store-cart-page-summary { position: sticky; top: 92px; display: block; padding: 24px; margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 15px 40px rgba(15,23,42,.05); }
.store-cart-page-summary[hidden] { display: none; }
.store-cart-page-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.store-cart-page-summary > div span { color: var(--muted); }
.store-cart-page-summary > div strong { font-size: 30px; text-align: right; }
.store-cart-page-summary > p:not(.eyebrow) { margin: 14px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.store-cart-page-summary > .store-text-button { display: block; margin: 10px auto 0; }
.store-cart-item.page { grid-template-columns: 82px minmax(0,1fr) auto; padding: 17px 0; }
.store-cart-item.page img { width: 82px; height: 82px; border-radius: 13px; }

@media (max-width: 860px) {
  .store-hero-grid { grid-template-columns: 1fr; }
  .store-hero-summary { max-width: 420px; }
  .store-cart-page-layout { grid-template-columns: 1fr; }
  .store-cart-page-summary { position: static; }
}
@media (max-width: 560px) {
  .store-hero { padding: 38px 0 44px; }
  .store-hero h1 { font-size: 42px; }
  .store-hero-actions { align-items: stretch; flex-direction: column; }
  .store-hero-actions .btn { width: 100%; }
  .store-hero-cart-link { text-align: left; }
  .store-hero-summary { width: 100%; padding: 20px; }
  .store-cart-page-heading { align-items: flex-start; flex-direction: column; }
  .store-cart-page-card { padding: 16px; }
  .store-cart-item.page { grid-template-columns: 62px minmax(0,1fr); }
  .store-cart-item.page img { width: 62px; height: 62px; }
  .store-cart-item.page > strong { grid-column: 2; }
}

/* Pulido operativo 2026-08: iconos SVG, retiros y accesibilidad */
.ui-icon {
  width: 1.15em;
  height: 1.15em;
  display: block;
  flex: 0 0 auto;
}
.brand-mark > span { display: block; transform: rotate(-45deg); line-height: 1; }
.metric-icon .ui-icon { width: 27px; height: 27px; }
.summary-icon .ui-icon { width: 23px; height: 23px; }
.quick-icon .ui-icon { width: 27px; height: 27px; }
.photo-placeholder .ui-icon { width: 21px; height: 21px; }
.btn .ui-icon { width: 17px; height: 17px; }
.mobile-menu-button .ui-icon { width: 22px; height: 22px; margin: auto; }
.chevron-icon { width: 15px; height: 15px; transition: transform .18s ease; }
.user-button[aria-expanded="true"] .chevron-icon { transform: rotate(180deg); }

.positive-text { color: var(--positive) !important; }
.danger-text { color: var(--danger) !important; }
.metric-card.positive .metric-icon { color: var(--positive); background: var(--positive-soft); border-color: color-mix(in srgb, var(--positive) 40%, transparent); }
.metric-card.danger .metric-icon { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 42%, transparent); }
.metric-card.danger .metric-note { color: var(--danger); }
.updated-at { white-space: nowrap; }

.user-dropdown { max-height: min(680px, calc(100vh - 110px)); overflow-y: auto; }
.user-menu-group,
.mobile-nav-group {
  display: block;
  padding: 9px 12px 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.user-menu-group:not(:first-child) { margin-top: 5px; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.mobile-nav-group:not(:first-child) { margin-top: 8px; border-top: 1px solid var(--border-soft); padding-top: 14px; }

.empty-svg {
  width: 54px;
  height: 54px;
  padding: 13px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(148,163,184,.35);
  border-radius: 15px;
}
.quick-arrow { color: var(--muted); font-size: 18px; }

.auth-trust {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 17px;
  padding: 8px 11px;
  color: var(--muted);
  background: var(--subtle-bg);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 12px;
}
.auth-trust-dot { width: 7px; height: 7px; background: var(--positive); border-radius: 50%; box-shadow: 0 0 0 4px var(--positive-soft); }
.auth-form { gap: 14px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 51px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 38px;
  height: 36px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.password-toggle:hover { color: var(--text); background: var(--surface-2); }
.password-toggle .ui-icon { width: 20px; height: 20px; }
.password-toggle.is-visible::after {
  content: "";
  position: absolute;
  width: 23px;
  height: 2px;
  background: currentColor;
  transform: rotate(-42deg);
  border-radius: 2px;
}

@media (max-width: 760px) {
  .updated-at { display: block; margin-top: 3px; }
  .inventory-table tr { grid-template-columns: 1fr 1fr; }
  .inventory-table td[data-label="Estado"] { grid-column: 1 / -1; }
  .auth-trust { border-radius: 12px; }
}

@media (max-width: 480px) {
  .inventory-table tr { grid-template-columns: 1fr; }
  .inventory-table td { grid-column: 1 / -1; }
  .metric-card { gap: 13px; }
  .metric-card strong { white-space: normal; }
}
