/* ==========================================================
   Boutiquet — Estilos del sistema
   Estilo: lujo minimalista · negro piedra + dorado
   Tipografía: Cormorant (títulos) / Montserrat (interfaz)
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant:wght@500;600;700&family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --color-primary: #1C1917;
  --color-on-primary: #FFFFFF;
  --color-secondary: #44403C;
  --color-accent: #A16207;
  --color-accent-soft: #FBF5E6;
  --color-background: #FAFAF9;
  --color-foreground: #0C0A09;
  --color-card: #FFFFFF;
  --color-muted: #F5F5F4;
  --color-muted-foreground: #57534E;
  --color-border: #E7E5E4;
  --color-border-strong: #D6D3D1;
  --color-success: #15803D;
  --color-success-soft: #DCFCE7;
  --color-warning: #B45309;
  --color-warning-soft: #FEF3C7;
  --color-destructive: #DC2626;
  --color-destructive-soft: #FEE2E2;

  --font-display: 'Cormorant', Georgia, serif;
  --font-body: 'Montserrat', system-ui, sans-serif;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(12, 10, 9, .05);
  --shadow: 0 4px 16px rgba(12, 10, 9, .06);
  --shadow-lg: 0 12px 40px rgba(12, 10, 9, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-foreground);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 6px; }

.icon { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

.display { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }
.muted { color: var(--color-muted-foreground); }
.num, .display { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Layout de la app ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--color-primary);
  color: #E7E5E4;
  display: flex; flex-direction: column;
  padding: 24px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 28px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #CA8A04, #A16207);
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 22px;
}
.brand-name { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: #fff; line-height: 1; }
.brand-name small { display: block; font-family: var(--font-body); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: #A8A29E; margin-top: 4px; }

.nav-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #78716C; padding: 16px 12px 8px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: #D6D3D1; font-weight: 500; font-size: 14px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(202,138,4,.16); color: #FCD34D; }
.nav a .pill { margin-left: auto; font-size: 11px; background: #CA8A04; color: #1C1917; padding: 1px 8px; border-radius: 99px; font-weight: 700; }

.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.05); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #44403C; color: #fff; font-weight: 600; font-size: 13px; }
.sidebar-foot .who { font-size: 13px; line-height: 1.3; }
.sidebar-foot .who span { display: block; color: #A8A29E; font-size: 12px; }
.sidebar-foot button { margin-left: auto; color: #A8A29E; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; }
.sidebar-foot button:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 32px;
  background: rgba(250,250,249,.82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--color-border);
}
.topbar h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.1; }
.topbar .sub { font-size: 13px; color: var(--color-muted-foreground); }
.topbar .spacer { flex: 1; }
.content { padding: 28px 32px 48px; }

/* ---------- Controles ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px; min-width: 280px;
  background: var(--color-card); border: 1px solid var(--color-border); border-radius: 12px;
  color: var(--color-muted-foreground);
}
.search input { border: 0; outline: 0; background: none; flex: 1; color: var(--color-foreground); }
.search kbd { font-size: 11px; border: 1px solid var(--color-border); border-radius: 6px; padding: 1px 6px; color: var(--color-muted-foreground); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: #292524; box-shadow: var(--shadow); }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: #854D0E; }
.btn-ghost { background: var(--color-card); border: 1px solid var(--color-border); }
.btn-ghost:hover { border-color: var(--color-border-strong); background: var(--color-muted); }
.btn-icon { width: 44px; padding: 0; }
.btn-block { width: 100%; }
.btn-lg { height: 56px; font-size: 16px; border-radius: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 99px;
  background: var(--color-card); border: 1px solid var(--color-border);
  font-size: 13px; font-weight: 600; color: var(--color-secondary); white-space: nowrap;
  transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--color-border-strong); }
.chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.chip .count { font-weight: 500; opacity: .6; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--color-success-soft); color: var(--color-success); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-danger { background: var(--color-destructive-soft); color: var(--color-destructive); }
.badge-neutral { background: var(--color-muted); color: var(--color-secondary); }

.card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.card-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.card-body { padding: 20px 24px 24px; }
.link { color: var(--color-accent); font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* Miniaturas de producto (placeholder de foto) */
.thumb {
  display: grid; place-items: center; border-radius: 10px; color: rgba(28,25,23,.55);
  background: linear-gradient(145deg, #F5F0E8, #E7DFD2);
}
.thumb.t2 { background: linear-gradient(145deg, #EDE9FE, #DDD6FE); color: rgba(76,29,149,.5); }
.thumb.t3 { background: linear-gradient(145deg, #E0F2FE, #BAE6FD); color: rgba(12,74,110,.5); }
.thumb.t4 { background: linear-gradient(145deg, #FCE7F3, #FBCFE8); color: rgba(131,24,67,.45); }
.thumb.t5 { background: linear-gradient(145deg, #DCFCE7, #BBF7D0); color: rgba(20,83,45,.45); }
.thumb.t6 { background: linear-gradient(145deg, #292524, #44403C); color: rgba(252,211,77,.8); }

/* Tablas */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted-foreground); padding: 12px 16px; border-bottom: 1px solid var(--color-border); background: var(--color-muted); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #FCFBFA; }
.table .right { text-align: right; }

@media (max-width: 1024px) {
  .app { grid-template-columns: 76px 1fr; }
  .brand-name, .nav a span, .nav-label, .sidebar-foot .who, .nav a .pill { display: none; }
  .sidebar { padding: 20px 12px; }
  .brand { justify-content: center; padding: 4px 0 24px; }
  .nav a { justify-content: center; padding: 0; }
  .sidebar-foot { justify-content: center; padding: 8px; }
  .sidebar-foot button { display: none; }
  .search { min-width: 0; }
}
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: auto 0 0 0; height: auto; flex-direction: row; padding: 6px 8px; z-index: 50; }
  .sidebar .brand, .sidebar-foot, .nav-label { display: none; }
  .sidebar .nav { display: flex; justify-content: space-around; width: 100%; }
  .nav a { flex: 1; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .topbar h1 { font-size: 24px; }
  .content { padding: 20px 16px 96px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================
   Componentes compartidos
   ========================================================== */
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hstack { display: flex; align-items: center; gap: 8px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.text-right { text-align: right; }

/* Alertas */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--color-success-soft); color: #14532D; border-color: #BBF7D0; }
.alert-error { background: var(--color-destructive-soft); color: #7F1D1D; border-color: #FECACA; }
.alert ul { margin-left: 18px; }

/* Formularios */
.f label, .label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.f input:not([type=checkbox]):not([type=radio]):not([type=file]), .f select, .f textarea, .input-text {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--color-border-strong); border-radius: 10px; background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.f textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, .input-text:focus { outline: 0; border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(28,25,23,.08); }
.f input[readonly] { background: var(--color-muted); color: var(--color-muted-foreground); }
.f .help { font-size: 12px; color: var(--color-muted-foreground); margin-top: 4px; }
.f .error, .error-text { font-size: 12px; color: var(--color-destructive); margin-top: 4px; font-weight: 500; }
.f .is-invalid { border-color: var(--color-destructive) !important; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; min-height: 44px; }
.check input { width: 18px; height: 18px; accent-color: var(--color-primary); }
.select { height: 44px; padding: 0 36px 0 14px; border: 1px solid var(--color-border); border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2357534E' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; font-size: 14px; cursor: pointer; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 220px; }
.toolbar input[type=date] { height: 44px; padding: 0 12px; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; }
.chips-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; width: 100%; height: 100%; }
.switch span { position: absolute; inset: 0; background: var(--color-border-strong); border-radius: 99px; transition: background .2s var(--ease); }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--color-success); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Tablas y celdas */
.table-wrap { overflow-x: auto; }
.table-card .table { min-width: 720px; }
.prod { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.prod .thumb, .prod img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.prod b { font-weight: 600; display: block; }
.prod small { color: var(--color-muted-foreground); font-size: 12px; }
.swatches { display: flex; gap: 4px; }
.swatches i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--color-border-strong); }
.sizes { display: flex; gap: 4px; flex-wrap: wrap; }
.sizes span { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--color-muted); color: var(--color-secondary); white-space: nowrap; }
.sizes span.out { text-decoration: line-through; opacity: .5; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions a, .row-actions button { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--color-muted-foreground); }
.row-actions a:hover, .row-actions button:hover { background: var(--color-muted); color: var(--color-foreground); }
.row-actions .danger:hover { background: var(--color-destructive-soft); color: var(--color-destructive); }
.table td.nowrap, .table .badge { white-space: nowrap; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--color-border); font-size: 13px; color: var(--color-muted-foreground); flex-wrap: wrap; }
.pager { display: flex; gap: 6px; }
.pager .btn { height: 36px; }
.pager .disabled { opacity: .45; pointer-events: none; }
.empty { text-align: center; color: var(--color-muted-foreground); padding: 48px 16px; }
.empty .icon { width: 36px; height: 36px; margin-bottom: 8px; stroke-width: 1.25; }

/* Modal (<dialog>) */
dialog.modal { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(480px, calc(100% - 32px)); margin: auto; box-shadow: var(--shadow-lg); color: var(--color-foreground); }
dialog.modal::backdrop { background: rgba(12,10,9,.45); backdrop-filter: blur(2px); }
dialog.modal .card-head { padding-top: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 24px 24px; }

/* ==========================================================
   Login
   ========================================================== */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 80% 20%, rgba(202,138,4,.35), transparent 45%), radial-gradient(circle at 10% 90%, rgba(161,98,7,.25), transparent 40%), var(--color-primary); }
.auth-art .brand { padding: 0; }
.auth-art h2 { font-family: var(--font-display); font-size: clamp(40px, 5vw, 64px); font-weight: 600; line-height: 1.02; max-width: 12ch; }
.auth-art h2 em { font-style: italic; color: #FCD34D; }
.auth-art p { color: #D6D3D1; max-width: 42ch; margin-top: 16px; }
.auth-cats { display: flex; gap: 12px; flex-wrap: wrap; }
.auth-cats span { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-radius: 99px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); font-size: 13px; color: #E7E5E4; }
.auth-form { display: grid; place-items: center; padding: 32px 24px; }
.auth-form form { width: 100%; max-width: 400px; }
.auth-form h1 { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1.1; }
.auth-form .lead { color: var(--color-muted-foreground); margin: 6px 0 28px; }
.auth-input { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border: 1px solid var(--color-border-strong); border-radius: 12px; background: #fff; color: var(--color-muted-foreground); transition: border-color .2s, box-shadow .2s; }
.auth-input:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(28,25,23,.08); }
.auth-input input { flex: 1; border: 0; outline: 0; background: none; color: var(--color-foreground); height: 100%; }
.auth-form .f { margin-bottom: 18px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { min-height: 280px; padding: 32px 24px; } .auth-cats { display: none; } }

/* ==========================================================
   Panel
   ========================================================== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 20px 22px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--color-muted-foreground); font-size: 13px; font-weight: 500; }
.kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--color-accent-soft); color: var(--color-accent); }
.kpi-val { font-family: var(--font-display); font-size: 38px; font-weight: 600; margin: 10px 0 4px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.delta { font-size: 12px; font-weight: 600; color: var(--color-success); }
.delta.down { color: var(--color-destructive); }
.delta.flat { color: var(--color-muted-foreground); }
.kpi.dark { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.kpi.dark .kpi-top { color: #A8A29E; }
.kpi.dark .kpi-ico { background: rgba(202,138,4,.18); color: #FCD34D; }
.grid-main { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-bottom: 16px; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding-top: 24px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 44px; min-height: 4px; border-radius: 10px 10px 4px 4px; background: #E7E5E4; position: relative; transition: background .2s; }
.bar:hover { background: #D6D3D1; }
.bar.hi { background: linear-gradient(180deg, #CA8A04, #A16207); }
.bar span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--color-muted-foreground); white-space: nowrap; }
.bar-col small { font-size: 12px; color: var(--color-muted-foreground); font-weight: 500; }
.cat-list { display: flex; flex-direction: column; gap: 16px; }
.cat-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.cat-row .thumb { width: 40px; height: 40px; }
.cat-row b { font-size: 14px; font-weight: 600; }
.track { height: 6px; background: var(--color-muted); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--color-primary); border-radius: 99px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.list-item:last-child { border-bottom: 0; }
.list-item .thumb, .list-item img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { font-size: 14px; font-weight: 600; display: block; }
.list-item small { color: var(--color-muted-foreground); font-size: 12px; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, 1fr); } .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .kpis, .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ==========================================================
   Punto de venta
   ========================================================== */
.app.pos-mode { height: 100vh; overflow: hidden; }
.pos { display: grid; grid-template-columns: 1fr 400px; height: 100vh; min-height: 0; min-width: 0; }
.catalog { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.catalog .topbar { position: static; }
.catalog .chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 32px; scrollbar-width: none; flex-shrink: 0; }
.products { flex: 1; overflow-y: auto; padding: 4px 32px 32px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; align-content: start; }
.p-card { text-align: left; background: var(--color-card); border: 1px solid var(--color-border); border-radius: 16px; padding: 10px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; position: relative; }
.p-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--color-border-strong); }
.p-card[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.p-card .thumb, .p-card img { aspect-ratio: 1 / 1; width: 100%; border-radius: 12px; object-fit: cover; display: grid; }
.p-card .thumb .icon { width: 44px; height: 44px; stroke-width: 1.25; }
.p-card h3 { font-size: 14px; font-weight: 600; margin: 10px 4px 2px; line-height: 1.3; }
.p-card .meta { font-size: 12px; color: var(--color-muted-foreground); margin: 0 4px; }
.p-card .foot { display: flex; align-items: center; justify-content: space-between; margin: 8px 4px 2px; }
.p-card .price { font-weight: 700; font-size: 15px; }
.p-card .add { width: 36px; height: 36px; border-radius: 10px; background: var(--color-primary); color: #fff; display: grid; place-items: center; }
.p-card .tag { position: absolute; top: 18px; left: 18px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--color-primary); color: #fff; }
.p-card .tag.low { background: var(--color-warning); }
.p-card .tag.out { background: var(--color-destructive); }
.ticket { background: var(--color-card); border-left: 1px solid var(--color-border); display: flex; flex-direction: column; min-height: 0; }
.t-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--color-border); }
.t-head .row { display: flex; align-items: center; justify-content: space-between; }
.t-head h2 { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.customer-btn { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed var(--color-border-strong); border-radius: 12px; width: 100%; text-align: left; }
.customer-btn:hover { background: var(--color-muted); }
.customer-btn .avatar { background: var(--color-accent-soft); color: var(--color-accent); }
.customer-btn b { font-size: 14px; display: block; }
.customer-btn small { font-size: 12px; color: var(--color-muted-foreground); }
.lines { flex: 1; overflow-y: auto; padding: 8px 24px; }
.line { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--color-border); align-items: center; }
.line .thumb, .line img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.line b { font-size: 14px; font-weight: 600; display: block; line-height: 1.3; }
.line small { font-size: 12px; color: var(--color-muted-foreground); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--color-border); border-radius: 10px; margin-top: 6px; }
.qty button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--color-secondary); }
.qty button:hover { background: var(--color-muted); }
.qty span { min-width: 24px; text-align: center; font-weight: 600; font-size: 14px; }
.line .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.line .del { color: var(--color-muted-foreground); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; }
.line .del:hover { color: var(--color-destructive); background: var(--color-destructive-soft); }
.t-foot { padding: 16px 24px 24px; border-top: 1px solid var(--color-border); background: #FCFBFA; }
.sum { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 4px 0; color: var(--color-muted-foreground); gap: 8px; }
.sum.total { color: var(--color-foreground); font-size: 15px; font-weight: 600; border-top: 1px dashed var(--color-border-strong); margin-top: 8px; padding-top: 12px; align-items: baseline; }
.sum.total strong { font-family: var(--font-display); font-size: 36px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; margin: 16px 0; }
.pay button { height: 64px; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--color-secondary); transition: all .2s; }
.pay button:hover { border-color: var(--color-border-strong); }
.pay button.on { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.pos-actions { display: grid; grid-template-columns: 56px 1fr; gap: 8px; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.variant-grid button { min-height: 64px; border: 1px solid var(--color-border); border-radius: 12px; padding: 8px; text-align: left; font-size: 13px; }
.variant-grid button:hover { border-color: var(--color-primary); }
.variant-grid button[disabled] { opacity: .45; cursor: not-allowed; }
.variant-grid b { display: block; font-size: 14px; }
.variant-grid small { color: var(--color-muted-foreground); }
.cust-results { max-height: 260px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: 12px; }
.cust-results button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: left; }
.cust-results button:last-child { border-bottom: 0; }
.cust-results button:hover { background: var(--color-muted); }
.change-box { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--color-success-soft); color: #14532D; display: flex; justify-content: space-between; font-weight: 600; }
.change-box.bad { background: var(--color-destructive-soft); color: #7F1D1D; }
@media (max-width: 1100px) { .pos { grid-template-columns: 1fr 340px; } }
@media (max-width: 820px) {
  .app.pos-mode { height: auto; overflow: visible; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .ticket { border-left: 0; border-top: 1px solid var(--color-border); }
  .products, .catalog .chips { padding-left: 16px; padding-right: 16px; }
  .products { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   Productos / Configuración
   ========================================================== */
.form-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.upload { border: 1.5px dashed var(--color-border-strong); border-radius: 14px; min-height: 180px; display: grid; place-items: center; text-align: center; color: var(--color-muted-foreground); font-size: 13px; background: var(--color-muted); cursor: pointer; overflow: hidden; position: relative; }
.upload img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.variants-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.variants-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted-foreground); padding: 8px 6px; }
.variants-table td { padding: 4px; }
.variants-table input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--color-border-strong); border-radius: 8px; background: #fff; }
.variants-table input[type=color] { padding: 2px; width: 44px; }
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.tabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 96px; }
.tabs a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 500; font-size: 14px; color: var(--color-secondary); }
.tabs a:hover { background: var(--color-muted); }
.card-head p { font-size: 13px; color: var(--color-muted-foreground); margin-top: 2px; }
.master { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 14px; background: var(--color-muted); }
.master b { display: block; font-size: 15px; }
.master small { color: var(--color-muted-foreground); font-size: 13px; }
.master .switch { margin-left: auto; }
.tax-area { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; transition: opacity .2s; }
.tax-area.off { opacity: .45; }
.tax-item { display: grid; grid-template-columns: 1fr 140px auto auto; gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--color-border); border-radius: 14px; }
.tax-item .switch { margin-bottom: 8px; }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio { flex: 1; min-width: 220px; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--color-border); border-radius: 12px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--color-primary); background: #FCFBFA; }
.radio input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--color-primary); }
.radio b { font-size: 14px; display: block; }
.radio small { font-size: 12px; color: var(--color-muted-foreground); }
.pay-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.pay-row:last-child { border-bottom: 0; }
.pay-row .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--color-muted); display: grid; place-items: center; }
.pay-row b { font-size: 14px; display: block; }
.pay-row small { font-size: 12px; color: var(--color-muted-foreground); }
.pay-row .switch { margin-left: auto; }
@media (max-width: 1100px) {
  .form-layout, .settings { grid-template-columns: 1fr; }
  .tabs { position: static; flex-direction: row; overflow-x: auto; }
  .tabs a { white-space: nowrap; }
}
@media (max-width: 700px) { .tax-item { grid-template-columns: 1fr 1fr; } }
.strike { text-decoration: line-through; }
@media print { .sidebar, .topbar .btn, .toolbar { display: none !important; } .app { display: block; } .content { padding: 0; } }
@media (max-width: 640px) { .pos { padding-bottom: 72px; } }

/* Lector de código de barras */
.scanner-ready { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--color-success-soft); color: var(--color-success); font-size: 12px; font-weight: 600; white-space: nowrap; }
.scan-toast { position: fixed; left: 50%; top: 20px; z-index: 200; transform: translate(-50%, -16px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); transition: opacity .2s var(--ease), transform .2s var(--ease); max-width: calc(100% - 32px); }
.scan-toast.show { opacity: 1; transform: translate(-50%, 0); }
.scan-toast.ok { background: var(--color-primary); color: #fff; }
.scan-toast.error { background: var(--color-destructive); color: #fff; }
.line.flash { animation: line-flash .9s var(--ease); }
@keyframes line-flash { from { background: var(--color-accent-soft); } to { background: transparent; } }
@media (max-width: 640px) { .scanner-ready { display: none; } }

/* ---------- Cupones ---------- */
.coupon-code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .04em; }
.type-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.type-pick label { position: relative; }
.type-pick input { position: absolute; opacity: 0; pointer-events: none; }
.type-pick span { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--color-border); border-radius: 10px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.type-pick input:checked + span { border-color: var(--color-primary); background: var(--color-muted); }
.type-pick input:focus-visible + span { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.coupon-issue { font-size: 12px; color: var(--color-warning); padding: 0 0 4px; }
