/* ==========================================================
   NOIR STORE — Sistema de gestión
   Tema negro / cromo
   ========================================================== */
:root {
  --bg: #08080a;
  --bg-2: #0d0d10;
  --surface: #121216;
  --surface-2: #17171c;
  --surface-3: #1e1e24;
  --line: #24242b;
  --line-2: #30303a;
  --text: #eceef2;
  --text-2: #b4b7bf;
  --muted: #7d818b;
  --chrome: linear-gradient(180deg, #ffffff 0%, #dfe1e6 38%, #8e919a 50%, #e6e8ec 60%, #b5b8c0 100%);
  --silver: #d9dbe0;
  --ok: #3ecf8e;
  --ok-bg: rgba(62, 207, 142, .12);
  --warn: #f2b84b;
  --warn-bg: rgba(242, 184, 75, .12);
  --err: #ff6161;
  --err-bg: rgba(255, 97, 97, .12);
  --info: #79a8ff;
  --info-bg: rgba(121, 168, 255, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .55);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Outfit", "Inter", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #d9dbe0; color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #26262d; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #34343d; }
::-webkit-scrollbar-track { background: transparent; }

.num, .mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.chrome-text {
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.err-text { color: var(--err); }

/* ---------- Boot ---------- */
.boot {
  position: fixed; inset: 0; display: grid; place-items: center; align-content: center; gap: 28px;
  background: radial-gradient(ellipse at 50% 30%, #17171c 0%, var(--bg) 60%); z-index: 100;
}
.boot img { width: 72px; opacity: .95; animation: pulse 1.6s ease-in-out infinite; }
.boot-bar { width: 160px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; background: var(--silver); animation: load 1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand img { height: 34px; width: auto; }
.brand .brand-sub { font-size: 10px; letter-spacing: .32em; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #5d6069; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: var(--text-2); text-decoration: none; font-weight: 500; transition: background .15s, color .15s;
}
.nav a svg { flex: none; opacity: .8; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-3); color: #fff; box-shadow: inset 2px 0 0 #e6e8ec; }
.nav a.active svg { opacity: 1; }
.nav a .nav-badge { margin-left: auto; font-size: 11px; background: var(--err-bg); color: var(--err); padding: 1px 7px; border-radius: 20px; }
.side-foot { border-top: 1px solid var(--line); padding: 12px 6px 0; margin-top: 12px; }
.user-card { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--chrome); color: #111; font-weight: 700; font-size: 13px;
}
.user-card .u-name { font-weight: 600; font-size: 13px; }
.user-card .u-role { font-size: 11.5px; color: var(--muted); }
.user-card .icon-btn { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: rgba(8, 8, 10, .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font: 600 20px/1.2 var(--display); margin: 0; letter-spacing: .01em; }
.topbar .top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.content { padding: 24px 28px 48px; flex: 1; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .spacer { flex: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 30px;
  background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill .dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pill .dot.err { background: var(--err); }
button.pill { cursor: pointer; }
button.pill:hover { border-color: var(--line-2); color: var(--text); }

/* ---------- Cards / Grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font: 600 14.5px var(--display); letter-spacing: .02em; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 12px; color: var(--muted); letter-spacing: .04em; display: flex; align-items: center; gap: 7px; }
.kpi .k-value { font: 600 25px/1.2 var(--display); margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.kpi.accent::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 232, 236, .1), transparent 70%);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-3); border-color: #3c3c47; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: #eceef2; color: #0a0a0c; border-color: #eceef2; font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn.chrome { background: var(--chrome); color: #0a0a0c; border: 0; font-weight: 700; letter-spacing: .02em; }
.btn.chrome:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--err-bg); border-color: rgba(255, 97, 97, .3); color: #ff8a8a; }
.btn.danger:hover { background: rgba(255, 97, 97, .2); }
.btn.success { background: var(--ok-bg); border-color: rgba(62, 207, 142, .35); color: #6ee0ac; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { padding: 13px 20px; font-size: 15px; border-radius: 11px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.icon-btn.danger:hover { color: var(--err); }
.btn-group { display: inline-flex; gap: 6px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, input:not([type]), input[type=text], input[type=number], input[type=password], input[type=email], input[type=tel],
input[type=date], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px;
  padding: 9px 12px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { border-color: #8e919a; box-shadow: 0 0 0 3px rgba(217, 219, 224, .08); }
input[type=number] { font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: #5b5e67; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237d818b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.7); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: #d9dbe0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; color: var(--text-2); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
.search-box { position: relative; min-width: 240px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 36px; }
.input-group { display: flex; }
.input-group > * { border-radius: 0; }
.input-group > :first-child { border-radius: 9px 0 0 9px; }
.input-group > :last-child { border-radius: 0 9px 9px 0; }
.input-group > .btn { border-left: 0; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; color: var(--text-2); cursor: pointer; font-weight: 500; font-size: 13px; }
.seg button.on { background: var(--surface-3); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 12px; border-radius: 30px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text-2); cursor: pointer; font-size: 12.5px; font-weight: 500; user-select: none;
}
.chip:hover { color: var(--text); border-color: #3c3c47; }
.chip.on { background: #eceef2; color: #0a0a0c; border-color: #eceef2; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
  position: sticky; top: 0;
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid #1b1b21; vertical-align: middle; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: #15151a; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .actions { text-align: right; white-space: nowrap; width: 1%; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: var(--surface-2); }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }
.tbl input, .tbl select { padding: 6px 9px; border-radius: 7px; }
.dt-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dt-pager { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.dt-pager .spacer { flex: 1; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { opacity: .35; margin-bottom: 10px; }
.thumb {
  width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--surface-3);
  display: inline-grid; place-items: center; font: 600 13px var(--display); color: var(--text-2); flex: none;
  border: 1px solid var(--line);
}
.cell-main { display: flex; align-items: center; gap: 11px; }
.cell-main .t1 { font-weight: 500; }
.cell-main .t2 { font-size: 12px; color: var(--muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.silver { background: #eceef2; color: #0a0a0c; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 10px 16px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { color: #fff; border-bottom-color: #e6e8ec; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .66); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; animation: fade .15s ease;
}
.modal {
  width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow);
  animation: rise .18s ease;
}
.modal.sm { max-width: 420px; }
.modal.md { max-width: 620px; }
.modal.lg { max-width: 880px; }
.modal.xl { max-width: 1120px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font: 600 17px var(--display); flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 16px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-left: 3px solid var(--ok);
  border-radius: 10px; box-shadow: var(--shadow); animation: rise .2s ease;
}
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }
.toast.info { border-left-color: var(--info); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}
.login-art {
  position: relative; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #1a1a20 0%, #08080a 65%); border-right: 1px solid var(--line);
}
.login-art img { width: min(62%, 460px); position: relative; z-index: 1; mix-blend-mode: lighten; }
.login-art .tagline { position: absolute; bottom: 36px; left: 0; right: 0; text-align: center; font-size: 11px; letter-spacing: .4em; color: var(--muted); text-transform: uppercase; }
.login-art::before {
  content: ""; position: absolute; width: 640px; height: 640px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .04); box-shadow: 0 0 0 80px rgba(255, 255, 255, .012), 0 0 0 160px rgba(255, 255, 255, .008);
}
.login-form { display: grid; place-items: center; padding: 40px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font: 600 26px var(--display); margin: 0 0 6px; }
.login-box p { color: var(--muted); margin: 0 0 26px; }
.user-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 20px; }
.user-pick button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--text-2);
}
.user-pick button.on { border-color: #d9dbe0; color: #fff; background: var(--surface-2); }
.user-pick .avatar { width: 40px; height: 40px; }
.pin-input { letter-spacing: .6em; text-align: center; font-size: 22px !important; padding: 12px !important; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.keypad button { padding: 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 18px; font-weight: 600; cursor: pointer; }
.keypad button:hover { background: var(--surface-2); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 0; height: calc(100vh - 61px); margin: -24px -28px -48px; }
.pos-left { display: flex; flex-direction: column; min-width: 0; padding: 18px 20px; gap: 14px; overflow: hidden; }
.pos-search { display: flex; gap: 10px; }
.pos-search .search-box { flex: 1; }
.pos-search input { padding-top: 12px; padding-bottom: 12px; font-size: 15px; }
.pos-cats { flex: none; }
.pos-grid {
  flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px; align-content: start; grid-auto-rows: max-content; padding-bottom: 20px;
}
.p-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; transition: border-color .15s, transform .1s; text-align: left; padding: 0;
}
.p-card:hover { border-color: #4a4a55; transform: translateY(-1px); }
.p-card .p-img { position: relative; flex: none; height: 118px; background: linear-gradient(160deg, #1d1d23, #111115); display: grid; place-items: center; overflow: hidden; }
.p-card .p-img img { width: 100%; height: 100%; object-fit: cover; }
.p-card .p-img .p-ini { font: 600 28px var(--display); color: #4a4c55; }
.p-card .p-info { padding: 10px 12px 12px; flex: none; }
.p-card .p-name { font-weight: 500; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.p-card .p-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 8px; margin-top: 6px; }
.p-card .p-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-card .p-stock { font-size: 11px; color: var(--muted); }
.p-card .p-stock.low { color: var(--warn); }
.p-card .p-stock.out { color: var(--err); }
.p-card.out { opacity: .55; }

.pos-right { background: var(--bg-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.cust-sel {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); cursor: pointer; text-align: left; width: 100%;
}
.cust-sel:hover { border-color: #4a4a55; }
.cust-sel .c-name { font-weight: 600; font-size: 13.5px; }
.cust-sel .c-sub { font-size: 11.5px; color: var(--muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 10px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 8px; border-bottom: 1px solid #1b1b21; }
.cart-item .ci-name { font-weight: 500; font-size: 13px; }
.cart-item .ci-sub { font-size: 11.5px; color: var(--muted); }
.cart-item .ci-total { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.cart-item .ci-ctrl { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.qty button { width: 28px; height: 28px; border: 0; background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.qty button:hover { background: var(--surface-3); }
.qty input { width: 48px; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 4px !important; background: var(--bg-2) !important; box-shadow: none !important; }
.ci-ctrl .mini { width: 90px; padding: 5px 8px !important; font-size: 12px; border-radius: 7px !important; }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.tot-row { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.tot-row.grand { color: #fff; font: 700 24px var(--display); align-items: baseline; }
.tot-row.grand span:first-child { font-size: 14px; font-weight: 600; letter-spacing: .14em; color: var(--text-2); }
/* Venta a crédito */
.credit-panel { border: 1px solid rgba(242, 184, 75, .35); background: linear-gradient(180deg, rgba(242, 184, 75, .06), transparent); border-radius: 12px; padding: 12px 14px; }
.credit-sum { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.credit-sum .tot-row { padding: 2px 0; }

/* Panel de pago en efectivo */
.cash-panel {
  border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 12px 12px;
  background: linear-gradient(180deg, #17171c 0%, #111115 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: border-color .2s, box-shadow .2s, opacity .2s;
}
.cash-panel.off { opacity: .45; }
.cp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cp-head span { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.cp-clear { background: none; border: 0; color: var(--muted); font-size: 11.5px; cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.cp-clear:hover { color: var(--text); background: var(--surface-3); }
.cp-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 8px; }
.cp-l { display: block; font-size: 11px; color: var(--text-2); margin-bottom: 4px; font-weight: 500; }
.cp-in { display: block; cursor: text; }
.cp-field {
  display: flex; align-items: baseline; gap: 6px; height: 50px; padding: 0 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid #3a3a44; transition: border-color .15s, box-shadow .15s;
}
.cp-field:focus-within { border-color: #d9dbe0; box-shadow: 0 0 0 3px rgba(217, 219, 224, .1); }
.cp-cur { font-size: 12px; font-weight: 600; color: var(--muted); align-self: center; }
.cp-field input {
  flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important;
  padding: 0 !important; text-align: right; font: 700 22px var(--display); color: #fff; letter-spacing: .01em;
}
.cp-out {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-end; padding: 0 12px; border-radius: 10px;
  border: 1px dashed var(--line-2); background: rgba(0, 0, 0, .25); transition: background .2s, border-color .2s; min-width: 0;
}
.cp-out .cp-l { margin: 0; }
.cp-val { font: 700 clamp(17px, 2.2vw, 22px) var(--display); max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.cash-panel.ok { border-color: rgba(62, 207, 142, .45); box-shadow: 0 0 0 1px rgba(62, 207, 142, .08), 0 8px 24px rgba(62, 207, 142, .08); }
.cash-panel.ok .cp-out { border: 1px solid rgba(62, 207, 142, .5); background: var(--ok-bg); }
.cash-panel.ok .cp-val { color: var(--ok); }
.cash-panel.ok .cp-out .cp-l { color: #7ee6b6; }
.cash-panel.err { border-color: rgba(255, 97, 97, .4); }
.cash-panel.err .cp-out { border: 1px solid rgba(255, 97, 97, .45); background: var(--err-bg); }
.cash-panel.err .cp-val { color: var(--err); }
.cash-panel.err .cp-out .cp-l { color: #ff9a9a; }
.cp-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.cp-quick:empty { display: none; }
.cp-chip {
  padding: 7px 4px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-chip:hover { border-color: #55555f; color: #fff; }
.cp-chip.on { background: #eceef2; color: #0a0a0c; border-color: #eceef2; }
.cart-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cart-actions .btn { padding-left: 6px; padding-right: 6px; }
.kbd { font-size: 10.5px; padding: 1px 5px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .25); opacity: .7; }

.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.pay-methods button {
  padding: 12px 8px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 500; font-size: 12.5px; color: var(--text-2);
}
.pay-methods button:hover { border-color: #4a4a55; color: var(--text); }
.pay-line { display: grid; grid-template-columns: 1fr 170px 32px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.big-total { text-align: center; padding: 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.big-total .bt-label { font-size: 11px; letter-spacing: .25em; color: var(--muted); text-transform: uppercase; }
.big-total .bt-value { font: 700 34px var(--display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 6px; }

.variant-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.variant-grid button {
  padding: 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; text-align: left;
}
.variant-grid button:hover:not(:disabled) { border-color: #d9dbe0; }
.variant-grid button:disabled { opacity: .4; cursor: not-allowed; }
.variant-grid .vg-name { font-weight: 600; }
.variant-grid .vg-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 220px; display: block; }
.chart .bar { fill: #3a3c44; transition: fill .15s; }
.chart .bar:hover { fill: #e6e8ec; }
.chart .bar.hi { fill: #d9dbe0; }
.chart .axis { fill: var(--muted); font-size: 10.5px; }
.chart .grid-line { stroke: #1f1f26; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; margin-bottom: 10px; }
.hbar .hb-track { grid-column: 1 / -1; height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.hbar .hb-fill { height: 100%; background: linear-gradient(90deg, #6d7079, #e6e8ec); border-radius: 6px; }
.hbar .hb-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .hb-val { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Misc ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #1b1b21; }
.list-item:last-child { border-bottom: 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.info-grid .ig-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.info-grid .ig-value { font-weight: 500; margin-top: 3px; }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; }
.callout.warn { background: var(--warn-bg); border-color: rgba(242, 184, 75, .3); color: #f5ca78; }
.callout.err { background: var(--err-bg); border-color: rgba(255, 97, 97, .3); color: #ff9a9a; }
.callout.ok { background: var(--ok-bg); border-color: rgba(62, 207, 142, .3); color: #7ee6b6; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.img-drop {
  width: 120px; height: 120px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--bg-2);
  display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center;
}
.img-drop img { width: 100%; height: 100%; object-fit: cover; }
.success-mark {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(62, 207, 142, .35);
}
.held-list .list-item { cursor: pointer; }
.held-list .list-item:hover { background: var(--surface-2); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-grid; }
  .g-3, .g-main, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pos { grid-template-columns: 1fr; height: auto; margin: -24px -16px -48px; }
  .pos-right { border-left: 0; border-top: 1px solid var(--line); min-height: 520px; }
  .pos-grid { max-height: 60vh; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .p-card .p-img { height: 84px; }
}
@media (max-width: 640px) {
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.c3, .form-grid.c4 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .search-box { min-width: 0; flex: 1; }
  .topbar .pill.hide-sm { display: none; }
}

/* Ofertas en el punto de venta */
.p-card .p-offer { position: absolute; top: 7px; left: 7px; z-index: 1; padding: 2px 8px; border-radius: 999px; background: #e5484d; color: #fff; font: 700 11px/1.5 var(--display, inherit); letter-spacing: .02em; box-shadow: 0 2px 8px rgba(0,0,0,.35); }

/* Términos y privacidad */
.legal-doc { max-height: 62vh; overflow: auto; padding: 4px 6px 4px 2px; line-height: 1.65; color: var(--text2, #c9ccd3); }
.legal-doc h1 { font: 700 21px/1.25 var(--display); color: var(--text, #fff); margin: 4px 0 4px; }
.legal-doc h2 { font: 600 15.5px/1.3 var(--display); color: var(--text, #fff); margin: 20px 0 6px; }
.legal-doc .meta { font-size: 12.5px; opacity: .7; margin: 0 0 14px; }
.legal-doc ul { padding-left: 20px; } .legal-doc li { margin: 3px 0; } .legal-doc b { color: var(--text, #fff); }
