:root {
  --navy: #0b1e3b;
  --navy-2: #102d57;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --ink: #13213a;
  --muted: #64748b;
  --line: #e4eaf2;
  --bg: #f4f7fb;
  --white: #fff;
  --warning: #b45309;
  --success: #16805b;
  --danger: #c23a3a;
  --shadow: 0 8px 30px rgba(20, 42, 80, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { color: var(--ink); background: var(--bg); line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

/* Navegación principal */
.sidebar {
  width: 272px;
  padding: 0;
  z-index: 30;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 0, rgba(55, 129, 255, .22), transparent 31%),
    linear-gradient(165deg, #102b52 0%, #081a35 75%);
  box-shadow: 8px 0 28px rgba(9, 27, 54, .08);
}
.sidebar-head { height: 88px; display: flex; align-items: center; padding: 0 22px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.brand { flex: 1; gap: 12px; min-width: 0; padding: 0; }
.brand > span:first-child, .login-mark > span, .login-mobile-brand > span {
  flex: 0 0 auto; width: 43px; height: 43px; display: grid; place-items: center;
  border-radius: 13px; background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff; font-weight: 850; letter-spacing: -.03em; box-shadow: 0 8px 18px rgba(37, 99, 235, .3);
}
.brand-copy { display: grid; min-width: 0; }
.brand-copy strong { overflow: hidden; color: #fff; font-size: .97rem; white-space: nowrap; text-overflow: ellipsis; }
.brand-copy small { color: #9db2cf; font-size: .72rem; font-weight: 500; }
.sidebar-close { display: none; border: 0; background: transparent; color: #b8c9df; font-size: 1.7rem; cursor: pointer; }
.sidebar-nav { flex: 1; display: block !important; overflow-y: auto; padding: 15px 14px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
.sidebar-nav .nav-label { margin: 15px 12px 7px; color: #7892b4; font-size: .66rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-nav .nav-label:first-child { margin-top: 1px; }
.sidebar .sidebar-nav a { position: relative; display: flex; align-items: center; gap: 12px; margin: 3px 0; padding: 10px 12px; color: #c4d2e5; border-radius: 10px; font-size: .9rem; font-weight: 600; transition: .18s ease; }
.sidebar .sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.sidebar .sidebar-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(55, 128, 255, .34), rgba(55, 128, 255, .13)); box-shadow: inset 3px 0 #60a5fa; }
.sidebar-nav svg { width: 19px; height: 19px; flex: 0 0 auto; }
.sidebar-profile { display: grid; grid-template-columns: 38px minmax(0,1fr) 34px; align-items: center; gap: 10px; padding: 15px 16px; border-top: 1px solid rgba(255,255,255,.1); background: rgba(1, 11, 25, .18); }
.sidebar-profile .avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgba(96,165,250,.2); color: #bfdbfe; font-weight: 800; }
.sidebar-profile > div { display: grid; min-width: 0; }
.sidebar-profile strong, .sidebar-profile small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-profile strong { color: #fff; font-size: .81rem; }
.sidebar-profile small { color: #91a7c4; font-size: .68rem; }
.sidebar-profile form { margin: 0; }
.sidebar-profile .logout { display: grid; place-items: center; width: 34px; height: 34px; margin: 0; padding: 0; border: 0; color: #9db2cf; border-radius: 9px; cursor: pointer; }
.sidebar-profile .logout:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-profile .logout svg { width: 18px; height: 18px; }

.main { min-height: 100vh; margin-left: 272px; }
.topbar { position: sticky; top: 0; z-index: 20; height: 72px; padding: 0 34px; border-color: rgba(221,228,238,.85); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); }
.topbar-context { display: flex !important; align-items: center; gap: 10px; text-align: left !important; }
.topbar-context > div { display: grid; text-align: left; }
.topbar-context strong { font-size: .82rem; }
.topbar-context small { margin: 0; font-size: .72rem; }
.online-dot { width: 9px; height: 9px; border: 2px solid #dcfce7; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.menu { width: 40px; height: 40px; place-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.menu svg { width: 21px; height: 21px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 25; background: rgba(5, 18, 38, .55); backdrop-filter: blur(2px); }
.content { max-width: 1500px; padding: 30px 34px 48px; }

/* Componentes generales */
h1 { font-size: clamp(1.65rem, 2.3vw, 2.15rem); letter-spacing: -.035em; }
h2 { letter-spacing: -.02em; }
.eyebrow { color: var(--blue); font-size: .69rem; letter-spacing: .14em; }
.page-title { gap: 20px; margin-bottom: 23px; }
.page-title > div:first-child { min-width: 0; }
.primary, .secondary, .danger-button, .search button { min-height: 42px; border-radius: 10px; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, #2875f4, #1d56d8); box-shadow: 0 6px 16px rgba(37,99,235,.18); }
.primary:hover { background: linear-gradient(135deg, #1e68e2, #1749be); box-shadow: 0 8px 20px rgba(37,99,235,.25); transform: translateY(-1px); }
.primary svg { width: 17px; height: 17px; }
.button { white-space: nowrap; }
.secondary { color: var(--ink); border: 1px solid var(--line); background: #fff; }
.panel, .stats article { border-color: rgba(218,226,237,.85); border-radius: 16px; box-shadow: var(--shadow); }
.panel-head { padding: 20px 22px; }
.panel-head h2 { margin-top: 4px; }
.panel-head a { font-size: .84rem; font-weight: 700; text-decoration: none; }
.stats { gap: 16px; }
.stats article { padding: 21px; }
table { min-width: 620px; }
th { padding-top: 12px; padding-bottom: 12px; background: #f8fafc; color: #738197; letter-spacing: .05em; }
td { color: #26364f; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f9fbfe; }
.badge { display: inline-flex; align-items: center; font-size: .76rem; font-weight: 750; }
.empty { color: #7a879a; }
.empty-icon { display: grid; place-items: center; width: 33px; height: 33px; margin: 0 auto 7px; border-radius: 50%; color: var(--success); background: #e7f8f1; font-weight: 900; }
.message { border: 1px solid #d7e5ff; box-shadow: 0 5px 18px rgba(30,64,175,.05); }
input, select, textarea, .search input, .login-card input, .sale-fields input, .sale-fields select {
  min-height: 43px; border-color: #d4dce8; border-radius: 9px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus, .search input:focus { border-color: #6da2f8; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.search { padding: 5px; border-radius: 12px; background: #fff; box-shadow: 0 3px 14px rgba(20,42,80,.04); }
.search input { border: 0; box-shadow: none !important; }
.form-panel, .product-form-panel, .record-form, .setup-card { border-radius: 16px; box-shadow: var(--shadow); }

/* Resumen */
.welcome-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 152px; margin-bottom: 22px; padding: 27px 30px; border-radius: 18px; color: #fff; background: linear-gradient(125deg, #102b52, #1757ad); box-shadow: 0 13px 32px rgba(16,55,111,.18); }
.welcome-card::after { content: ''; position: absolute; width: 260px; height: 260px; right: -68px; top: -133px; border: 38px solid rgba(255,255,255,.07); border-radius: 50%; }
.welcome-card > * { position: relative; z-index: 1; }
.welcome-card .eyebrow { color: #9ac4ff; }
.welcome-card h1 { margin: 5px 0 4px; }
.welcome-card p:last-child { margin: 0; color: #cadcf2; }
.welcome-actions { display: flex; align-items: center; gap: 12px; }
.cash-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid rgba(255,255,255,.17); border-radius: 99px; background: rgba(5,20,43,.22); color: #dae6f6; font-size: .77rem; font-weight: 700; white-space: nowrap; }
.cash-pill i { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.17); }
.cash-pill.open i { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.17); }
.dashboard-stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
.dashboard-stats article { display: flex; align-items: center; gap: 15px; }
.dashboard-stats article > div:last-child { display: grid; min-width: 0; }
.dashboard-stats strong { margin: 2px 0; color: #11213a; font-size: 1.52rem; letter-spacing: -.035em; }
.dashboard-stats small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .7rem; }
.stat-icon { display: grid; flex: 0 0 auto; place-items: center; width: 46px; height: 46px; border-radius: 13px; }
.stat-icon svg { width: 23px; height: 23px; }
.stat-icon.blue { color: #2563eb; background: #eaf2ff; }
.stat-icon.violet { color: #7c3aed; background: #f1eaff; }
.stat-icon.amber { color: #c26b09; background: #fff4dc; }
.stat-icon.green { color: #16805b; background: #e6f7f0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.75fr); gap: 18px; align-items: start; }
.quick-panel { overflow: hidden; }
.quick-links { display: grid; }
.quick-links > a { display: grid; grid-template-columns: 39px minmax(0,1fr) 18px; align-items: center; gap: 12px; padding: 14px 19px; color: var(--ink); border-bottom: 1px solid var(--line); text-decoration: none; transition: .15s ease; }
.quick-links > a:last-child { border: 0; }
.quick-links > a:hover { padding-left: 22px; background: #f7faff; }
.quick-links > a > span { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: var(--blue); background: var(--blue-soft); }
.quick-links svg { width: 19px; height: 19px; }
.quick-links div { display: grid; }
.quick-links strong { font-size: .82rem; }
.quick-links small { color: var(--muted); font-size: .7rem; }
.quick-links b { color: #94a3b8; font-size: 1.4rem; }

/* Ventas y tarjetas */
.pos-search { top: 80px; padding-top: 4px; }
.product-card { min-height: 130px; padding: 17px; border-radius: 14px; box-shadow: 0 4px 14px rgba(20,42,80,.035); transition: .16s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(37,99,235,.12); }
.product-card b { font-size: 1.08rem; }
.cart-panel { top: 88px; }
.quantity button { cursor: pointer; }
.checkout { min-height: 48px; }
.receipt, .quote-document { border-radius: 16px; box-shadow: var(--shadow); }

/* Acceso */
.login-page { display: block; padding: 0; background: #eef3f9; }
.login-shell { display: grid; grid-template-columns: minmax(400px,1.05fr) minmax(390px,.95fr); width: 100%; min-height: 100vh; background: #fff; }
.login-visual { position: relative; overflow: hidden; padding: 60px; color: #fff; background: linear-gradient(145deg, #0b2348, #1658ad); }
.login-visual::before, .login-visual::after { content: ''; position: absolute; border-radius: 50%; border: 70px solid rgba(255,255,255,.055); }
.login-visual::before { width: 430px; height: 430px; right: -220px; top: -200px; }
.login-visual::after { width: 350px; height: 350px; left: -205px; bottom: -210px; }
.login-visual-content { position: relative; z-index: 1; display: flex; flex-direction: column; width: 100%; height: 100%; }
.login-mark, .login-mobile-brand { display: flex; align-items: center; gap: 13px; font-weight: 800; }
.login-mark > span { width: 46px; height: 46px; }
.login-message { max-width: 610px; margin: auto 0; }
.login-kicker { display: inline-block; margin-bottom: 15px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.15); border-radius: 99px; color: #bad4f8; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.login-message h1 { max-width: 590px; margin: 0 0 17px; font-size: clamp(2.4rem, 4.5vw, 4.5rem); line-height: 1.02; letter-spacing: -.055em; }
.login-message p { max-width: 500px; color: #c1d3ea; font-size: 1.05rem; }
.book-shapes { display: flex; align-items: end; gap: 8px; height: 80px; }
.book-shapes i { display: block; width: 20px; border-radius: 4px 4px 2px 2px; background: rgba(255,255,255,.16); transform: rotate(-5deg); }
.book-shapes i:nth-child(1) { height: 52px; }
.book-shapes i:nth-child(2) { height: 68px; background: rgba(96,165,250,.38); transform: none; }
.book-shapes i:nth-child(3) { height: 45px; transform: rotate(8deg); }
.login-card { align-self: center; width: min(450px, calc(100% - 60px)); margin: 0 auto; padding: 38px; border: 0; box-shadow: none; }
.login-card .eyebrow { margin-bottom: 7px; }
.login-card h2 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); }
.login-card form { gap: 18px; margin-top: 26px; }
.login-card label { gap: 8px; color: #35445b; font-size: .78rem; }
.input-wrap { position: relative; display: block; }
.input-wrap svg { position: absolute; z-index: 1; left: 13px; top: 50%; width: 18px; height: 18px; color: #8795aa; transform: translateY(-50%); pointer-events: none; }
.login-card .input-wrap input { height: 48px; padding-left: 42px; }
.login-card .primary { width: 100%; height: 49px; margin-top: 4px; }
.login-card .primary span { margin-left: auto; font-size: 1.2rem; }
.login-mobile-brand { display: none; margin-bottom: 37px; color: var(--ink); }
.login-help { display: block; margin-top: 23px; color: #8491a3; text-align: center; }

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

@media (max-width: 850px) {
  body.menu-open { overflow: hidden; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: none; }
  .sidebar-close { display: block; }
  .sidebar-overlay.visible { display: block; }
  .main { margin-left: 0; }
  .menu { display: grid; }
  .topbar { padding: 0 18px; }
  .content { padding: 23px 18px 40px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-page { display: grid; place-items: center; padding: 25px 0; background: linear-gradient(155deg, #e9f2ff, #f7f9fc); }
  .login-card { width: min(450px, calc(100% - 32px)); padding: 35px 30px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(17,45,87,.12); }
  .login-mobile-brand { display: flex; }
}

@media (max-width: 650px) {
  .content { padding-left: 14px; padding-right: 14px; }
  .topbar-context small { max-width: 170px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .welcome-card { align-items: flex-start; flex-direction: column; padding: 24px 21px; }
  .welcome-actions { width: 100%; justify-content: space-between; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .dashboard-stats article { min-height: 94px; }
  .page-title { flex-direction: column; }
  .page-title .primary, .page-title .button { width: 100%; }
  .stats { grid-template-columns: 1fr; }
  .panel-head { padding: 17px; }
  th, td { padding-left: 16px; padding-right: 16px; }
}

@media print {
  .sidebar-overlay { display: none !important; }
  .content { max-width: none; }
}

/* ================================================================
   EMNA · interfaz clara inspirada en el sistema visual de Apple
   ================================================================ */
:root {
  --navy: #1d1d1f;
  --navy-2: #333333;
  --blue: #0071e3;
  --blue-dark: #0066cc;
  --blue-soft: #f4f8fb;
  --sky: #f4f8fb;
  --ink: #1d1d1f;
  --muted: #707070;
  --line: #d2d2d7;
  --bg: #f5f5f7;
  --white: #ffffff;
  --warning: #9a6700;
  --success: #18794e;
  --danger: #b42318;
  --shadow: none;
  --radius-card: 8px;
  --radius-input: 8px;
  --radius-pill: 980px;
}

body {
  font-family: "SF Pro Text", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  letter-spacing: -.01em;
}

h1, h2, h3, .stats strong, .grand-total strong {
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1 { font-weight: 600; letter-spacing: -.025em; }
h2, h3 { font-weight: 600; letter-spacing: -.015em; }

/* Navegación: una superficie plana y silenciosa */
.sidebar {
  width: 256px;
  background: #1d1d1f;
  box-shadow: none;
}
.sidebar-head {
  height: 76px;
  padding: 0 20px;
  border-bottom: 1px solid #333333;
}
.brand { gap: 11px; }
.brand > span:first-child,
.login-mark > span,
.login-mobile-brand > span {
  width: 38px;
  height: 38px;
  border: 1px solid #474747;
  border-radius: 8px;
  color: #f5f5f7;
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}
.brand-copy strong { font-size: .92rem; font-weight: 600; }
.brand-copy small { color: #a1a1a6; font-size: .69rem; }
.sidebar-nav { padding: 12px 12px 18px; }
.sidebar-nav .nav-label {
  margin: 16px 10px 6px;
  color: #86868b;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .1em;
}
.sidebar .sidebar-nav a {
  gap: 11px;
  margin: 2px 0;
  padding: 9px 11px;
  border-radius: 8px;
  color: #d2d2d7;
  font-size: .84rem;
  font-weight: 400;
  transition: color .15s ease, background .15s ease;
}
.sidebar .sidebar-nav a:hover {
  color: #fff;
  background: #2c2c2e;
  transform: none;
}
.sidebar .sidebar-nav a.active {
  color: #fff;
  background: #333336;
  box-shadow: none;
  font-weight: 600;
}
.sidebar .sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: #2997ff;
}
.sidebar-profile {
  padding: 13px 14px;
  border-top-color: #333333;
  background: #1d1d1f;
}
.sidebar-profile .avatar {
  border: 1px solid #474747;
  border-radius: 50%;
  color: #f5f5f7;
  background: #2c2c2e;
  font-weight: 600;
}
.sidebar-profile strong { font-weight: 600; }
.sidebar-profile small { color: #86868b; }
.sidebar-profile .logout { border-radius: 50%; }

.main { margin-left: 256px; }
.topbar {
  height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(210, 210, 215, .88);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(18px);
}
.topbar-context strong { font-weight: 600; }
.online-dot {
  width: 8px;
  height: 8px;
  border: 0;
  background: #30d158;
  box-shadow: none;
}
.menu {
  border-color: var(--line);
  border-radius: 50%;
  background: transparent;
}
.content { max-width: 1440px; padding: 36px 40px 56px; }

/* Componentes: jerarquía mediante espacio y líneas, no sombras */
.eyebrow {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
}
.page-title { margin-bottom: 28px; }
.page-title h1 { margin-top: 5px; font-size: clamp(1.8rem, 2.5vw, 2.35rem); }
.page-title small { font-size: .86rem; }

.primary,
.secondary,
.danger-button,
.search button,
.button,
.camera-button,
.quote-status button {
  min-height: 40px;
  border-radius: var(--radius-pill);
  font-size: .9rem;
  font-weight: 400;
  box-shadow: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease;
}
.primary {
  color: #fff;
  background: #0071e3;
  box-shadow: none;
}
.primary:hover {
  background: #0077ed;
  box-shadow: none;
  transform: none;
}
.primary:disabled { background: #e2e2e5; color: #858585; }
.secondary,
.search button,
.camera-button,
.quote-status button {
  color: #0066cc;
  border: 1px solid #0066cc;
  background: transparent;
}
.secondary:hover,
.search button:hover,
.camera-button:hover,
.quote-status button:hover { color: #fff; background: #0066cc; }
.danger-button { border: 1px solid #b42318; background: transparent; color: #b42318; }
.danger-button:hover { background: #b42318; color: #fff; }
.link-button, .panel-head a { color: #0066cc; font-weight: 400; }

.panel,
.stats article,
.form-panel,
.product-form-panel,
.record-form,
.setup-card,
.receipt,
.quote-document,
.product-card,
.barcode-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: none;
}
.panel-head { padding: 19px 22px; }
.stats { gap: 12px; }
.stats article { padding: 22px; }
.stats strong { font-weight: 600; }

input,
select,
textarea,
.search input,
.login-card input,
.sale-fields input,
.sale-fields select,
.record-form input,
.record-form select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: #fff;
  color: var(--ink);
}
input:focus,
select:focus,
textarea:focus,
.search input:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, .16);
}
.search {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}
.search input { border: 0; background: transparent; }

table { min-width: 620px; }
th {
  padding-top: 13px;
  padding-bottom: 13px;
  color: var(--muted);
  background: #f5f5f7;
  font-weight: 600;
  letter-spacing: .04em;
}
td { color: #333333; }
tbody tr:hover { background: #f4f8fb; }
.badge, .status-open, .status-closed { border-radius: var(--radius-pill); font-weight: 600; }
.message { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }

/* Resumen */
.welcome-card {
  min-height: 158px;
  margin-bottom: 16px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  color: var(--ink);
  background: #fff;
  box-shadow: none;
}
.welcome-card::after { display: none; }
.welcome-card .eyebrow { color: var(--muted); }
.welcome-card h1 { color: var(--ink); font-size: clamp(2rem, 3vw, 2.75rem); font-weight: 600; }
.welcome-card p:last-child { color: var(--muted); }
.cash-pill {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: #f5f5f7;
  font-weight: 400;
}
.cash-pill i { box-shadow: none; }
.dashboard-stats { gap: 12px; }
.dashboard-stats article { gap: 16px; }
.dashboard-stats strong { color: var(--ink); font-size: 1.6rem; }
.stat-icon,
.stat-icon.blue,
.stat-icon.violet,
.stat-icon.amber,
.stat-icon.green {
  border: 1px solid #e2e2e5;
  border-radius: 8px;
  color: #2997ff;
  background: #f4f8fb;
}
.dashboard-grid { gap: 12px; }
.quick-links > a { transition: background .15s ease; }
.quick-links > a:hover { padding-left: 19px; background: #f4f8fb; }
.quick-links > a > span {
  border: 1px solid #e2e2e5;
  border-radius: 8px;
  color: #2997ff;
  background: #f4f8fb;
}

/* Punto de venta */
.pos-search { top: 72px; }
.product-grid { gap: 10px; }
.product-card {
  min-height: 136px;
  padding: 18px;
  transition: border-color .15s ease, background .15s ease;
}
.product-card:hover {
  border-color: #2997ff;
  background: #f4f8fb;
  box-shadow: none;
  transform: none;
}
.product-card b { color: #0066cc; font-size: 1.08rem; }
.cart-panel { top: 76px; }
.quantity button { border-radius: 50%; }
.checkout { min-height: 46px; }

/* Acceso */
.login-page { background: #f5f5f7; }
.login-shell { background: #fff; }
.login-visual {
  padding: 64px;
  color: #f5f5f7;
  background: #1d1d1f;
}
.login-visual::before,
.login-visual::after { display: none; }
.login-mark { font-weight: 600; }
.login-kicker {
  border-color: #474747;
  border-radius: var(--radius-pill);
  color: #a1a1a6;
  font-weight: 400;
}
.login-message h1 { font-weight: 600; letter-spacing: -.04em; }
.login-message p { color: #a1a1a6; font-weight: 300; }
.book-shapes i { border-radius: 2px; background: #474747; }
.book-shapes i:nth-child(2) { background: #2997ff; }
.login-card { max-width: 460px; padding: 42px; }
.login-card h2 { font-weight: 600; }
.login-card label { font-weight: 600; }
.login-card .primary { border-radius: var(--radius-pill); }
.login-help { color: #858585; }

/* Ajustes de superficies auxiliares */
.payment-amount,
.conversion-summary,
.void-confirm dl div,
.report-filter { border: 1px solid var(--line); border-radius: 8px; background: #f4f8fb; }
.settings-links { gap: 12px; }
.settings-links a { border-radius: 8px; }
.settings-links strong { color: #0066cc; font-weight: 600; }

@media (max-width: 850px) {
  .main { margin-left: 0; }
  .topbar { padding: 0 18px; }
  .content { padding: 26px 18px 44px; }
  .login-page { background: #f5f5f7; }
  .login-card {
    border-radius: 8px;
    box-shadow: none;
  }
}

@media (max-width: 650px) {
  .content { padding: 22px 14px 38px; }
  .welcome-card { padding: 25px 22px; }
  .welcome-actions { align-items: stretch; flex-direction: column; }
  .welcome-actions .primary { width: 100%; }
  .page-title { gap: 16px; }
  .panel-head { padding: 17px; }
}

/* ================================================================
   Identidad Librería EMNA · edición de marca
   ================================================================ */
:root {
  --brand-green: #80d51f;
  --brand-green-dark: #5ea913;
  --brand-blue: #3d5bb3;
  --brand-blue-dark: #29458f;
  --brand-sky: #79d0ef;
  --brand-pink: #f5315c;
  --brand-yellow: #f2d91d;
  --brand-ink: #21152d;
  --brand-wash: #f6faef;
  --navy: var(--brand-blue-dark);
  --blue: var(--brand-blue);
  --blue-dark: var(--brand-blue-dark);
  --blue-soft: #eef2ff;
  --sky: #edf9fd;
  --ink: var(--brand-ink);
  --muted: #6c6873;
  --line: #e2e4df;
  --bg: #f7f8f5;
  --success: #498c12;
  --shadow-soft: 0 10px 30px rgba(33, 21, 45, .055);
  --shadow-hover: 0 16px 38px rgba(61, 91, 179, .12);
  --ease-emna: cubic-bezier(.22, 1, .36, 1);
}

body {
  background:
    radial-gradient(circle at 94% 2%, rgba(128, 213, 31, .07), transparent 22rem),
    var(--bg);
}

/* Aparición y salida suave entre pantallas */
.content {
  animation: emna-page-in .5s var(--ease-emna) both;
  transform-origin: top center;
}
body.page-leaving .content {
  opacity: 0;
  transform: translateY(5px) scale(.998);
  transition: opacity .14s ease, transform .14s ease;
}
@keyframes emna-page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Marca */
.brand { padding: 0; }
.brand-mark {
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  width: 48px !important;
  height: 48px !important;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 6px 18px rgba(20, 32, 76, .22) !important;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy strong { font-size: .94rem; }
.brand-copy small { color: rgba(255,255,255,.62); letter-spacing: .015em; }

/* Navegación con el azul del libro y verde del arco */
.sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 27%),
    linear-gradient(165deg, #314f9e 0%, #263d82 56%, #211c4e 100%);
}
.sidebar-head { height: 84px; border-bottom-color: rgba(255,255,255,.11); }
.sidebar-nav .nav-label { color: rgba(255,255,255,.48); }
.sidebar .sidebar-nav a {
  color: rgba(255,255,255,.76);
  border: 1px solid transparent;
  transition: color .22s ease, background .22s ease, border-color .22s ease, transform .22s var(--ease-emna);
}
.sidebar .sidebar-nav a:hover {
  color: #fff;
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.09);
  transform: translateX(3px);
}
.sidebar .sidebar-nav a.active {
  color: #fff;
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.14);
}
.sidebar .sidebar-nav a.active::before {
  width: 4px;
  height: 22px;
  background: var(--brand-green);
  box-shadow: 0 0 16px rgba(128,213,31,.55);
}
.sidebar-profile {
  border-top-color: rgba(255,255,255,.11);
  background: rgba(20,22,61,.22);
}
.sidebar-profile .avatar {
  border-color: rgba(255,255,255,.17);
  background: rgba(128,213,31,.18);
  color: #eaffd1;
}
.sidebar-profile small { color: rgba(255,255,255,.57); }
.sidebar-profile .logout { color: rgba(255,255,255,.65); transition: .2s ease; }
.sidebar-profile .logout:hover { color: #fff; background: rgba(255,255,255,.12); transform: rotate(-4deg); }

.topbar {
  border-bottom-color: rgba(61,91,179,.1);
  box-shadow: 0 1px 0 rgba(255,255,255,.8);
}
.online-dot { background: var(--brand-green); }
.menu { transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease; }
.menu:hover { color: var(--brand-blue); border-color: var(--brand-blue); background: #eef2ff; transform: scale(1.04); }

/* Botones más táctiles y fluidos */
.primary,
.secondary,
.danger-button,
.search button,
.camera-button,
.quote-status button {
  position: relative;
  padding-left: 18px;
  padding-right: 18px;
  overflow: hidden;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: -.01em;
  transition:
    color .22s ease,
    background .22s ease,
    border-color .22s ease,
    box-shadow .22s ease,
    transform .22s var(--ease-emna);
}
.primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #4969c4, var(--brand-blue));
  box-shadow: 0 7px 18px rgba(61,91,179,.2);
}
.primary:hover {
  background: linear-gradient(135deg, #5575ce, #334fa5);
  box-shadow: 0 11px 24px rgba(61,91,179,.27);
  transform: translateY(-2px);
}
.primary:active { box-shadow: 0 4px 10px rgba(61,91,179,.18); transform: translateY(0) scale(.985); }
.secondary,
.search button,
.camera-button,
.quote-status button {
  color: var(--brand-blue);
  border-color: rgba(61,91,179,.55);
  background: rgba(255,255,255,.88);
}
.secondary:hover,
.search button:hover,
.camera-button:hover,
.quote-status button:hover {
  color: #fff;
  border-color: var(--brand-blue);
  background: var(--brand-blue);
  box-shadow: 0 8px 18px rgba(61,91,179,.16);
  transform: translateY(-1px);
}
.link-button, .panel-head a, .receipt-actions a { color: var(--brand-blue); transition: color .18s ease, opacity .18s ease; }
.link-button:hover, .panel-head a:hover, .receipt-actions a:hover { color: var(--brand-blue-dark); text-decoration: underline; text-underline-offset: 3px; }

/* Contenedores */
.panel,
.stats article,
.form-panel,
.product-form-panel,
.setup-card,
.receipt,
.quote-document,
.product-card,
.barcode-dialog {
  border-color: rgba(33,21,45,.1);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}
.stats article,
.quick-links > a,
.settings-links a {
  transition: transform .28s var(--ease-emna), box-shadow .28s ease, border-color .28s ease, background .28s ease;
}
.stats article:hover,
.settings-links a:hover {
  border-color: rgba(61,91,179,.2);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.panel-head { background: linear-gradient(180deg, #fff, #fdfefd); }
.panel-head h2 { color: var(--brand-ink); }
.eyebrow { color: var(--brand-green-dark); }
.page-title h1 { color: var(--brand-ink); }

.welcome-card {
  min-height: 170px;
  border-color: rgba(128,213,31,.24);
  border-radius: 16px;
  background:
    linear-gradient(112deg, rgba(128,213,31,.14), rgba(121,208,239,.07) 48%, #fff 82%);
  box-shadow: var(--shadow-soft);
}
.welcome-card::after {
  display: block;
  width: 250px;
  height: 170px;
  right: 20px;
  top: 0;
  border: 0;
  border-radius: 0;
  background: url("../brand/logo-emna-mark.d271c06dbe03.png") center / contain no-repeat;
  opacity: .07;
}
.welcome-card .eyebrow { color: var(--brand-green-dark); }
.cash-pill { border-color: rgba(61,91,179,.15); background: rgba(255,255,255,.72); }
.cash-pill.open { color: #397d0d; border-color: rgba(128,213,31,.34); background: #f3fde8; }

.stat-icon,
.stat-icon.blue {
  color: var(--brand-blue);
  border-color: rgba(61,91,179,.12);
  background: #eef2ff;
}
.stat-icon.violet { color: var(--brand-pink); border-color: rgba(245,49,92,.13); background: #fff0f4; }
.stat-icon.amber { color: #a58900; border-color: rgba(242,217,29,.28); background: #fffbe3; }
.stat-icon.green { color: var(--brand-green-dark); border-color: rgba(128,213,31,.22); background: #f2fbe8; }
.quick-links > a:hover { background: var(--brand-wash); transform: translateX(3px); }
.quick-links > a > span { color: var(--brand-blue); border-color: rgba(121,208,239,.28); background: #edf9fd; }

/* Formularios y tablas */
input,
select,
textarea,
.search input,
.login-card input,
.sale-fields input,
.sale-fields select,
.record-form input,
.record-form select {
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:hover,
select:hover,
textarea:hover { border-color: #bec6d9; }
input:focus,
select:focus,
textarea:focus,
.search input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(61,91,179,.11);
}
.search {
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(33,21,45,.045);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search:focus-within { border-color: rgba(61,91,179,.48); box-shadow: 0 10px 28px rgba(61,91,179,.1); }
th { background: #f5f7f2; }
tbody tr { transition: background .18s ease; }
tbody tr:hover { background: #f6faef; }

/* Productos */
.product-card {
  border-radius: 14px;
  transition: border-color .24s ease, background .24s ease, box-shadow .24s ease, transform .24s var(--ease-emna);
}
.product-card:hover {
  border-color: rgba(61,91,179,.38);
  background: #fff;
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.product-card:active { transform: translateY(-1px) scale(.985); }
.product-card b { color: var(--brand-blue); }
.quantity button { transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease; }
.quantity button:hover { color: #fff; border-color: var(--brand-blue); background: var(--brand-blue); transform: scale(1.07); }

/* Acceso con logo */
.login-visual {
  background:
    linear-gradient(145deg, rgba(61,91,179,.98), rgba(33,21,45,.98));
}
.login-visual::after {
  display: block;
  width: 620px;
  height: 430px;
  right: -150px;
  top: auto;
  bottom: -95px;
  border: 0;
  border-radius: 0;
  background: url("../brand/logo-emna-mark.d271c06dbe03.png") center / contain no-repeat;
  opacity: .075;
}
.login-mark,
.login-mobile-brand { gap: 13px; }
.login-mark img,
.login-mobile-brand img {
  display: block;
  width: 66px;
  height: 48px;
  object-fit: contain;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255,255,255,.96);
}
.login-mark > span,
.login-mobile-brand > span {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
}
.login-kicker { color: #dcf8bd; border-color: rgba(128,213,31,.4); background: rgba(128,213,31,.09); }
.login-message p { color: rgba(255,255,255,.72); }
.book-shapes i { background: var(--brand-sky); opacity: .65; }
.book-shapes i:nth-child(2) { background: var(--brand-pink); }
.book-shapes i:nth-child(3) { background: var(--brand-yellow); }
.login-card { animation: emna-card-in .62s .08s var(--ease-emna) both; }
@keyframes emna-card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Documentos e impresión */
.document-logo {
  display: block;
  width: 150px;
  height: auto;
  margin: 0 auto 12px;
}
.receipt-brand h1 { color: var(--brand-ink); }
.payment-amount { border-color: rgba(121,208,239,.3); background: #edf9fd; }
.payment-amount strong { color: var(--brand-blue); }

@media (max-width: 850px) {
  .sidebar { transition: transform .32s var(--ease-emna); }
  .sidebar-overlay { transition: opacity .25s ease; }
  .login-mobile-brand { color: var(--brand-ink); }
  .login-card { border-color: rgba(61,91,179,.12); box-shadow: 0 20px 55px rgba(33,21,45,.09); }
}

@media (max-width: 650px) {
  .welcome-card::after { right: -65px; opacity: .045; }
  .primary, .secondary, .danger-button, .search button, .camera-button { min-height: 44px; }
  .login-mobile-brand img { width: 72px; height: 50px; }
}

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

@media print {
  .document-logo { width: 115px; }
  .receipt { box-shadow: none; }
}

/* Menú plegable y encabezado de marca legible */
.sidebar {
  width: 276px;
  transition: transform .32s var(--ease-emna);
}
.main {
  margin-left: 276px;
  transition: margin-left .32s var(--ease-emna);
}
.sidebar-head {
  min-height: 92px;
  height: auto;
  gap: 8px;
  padding: 12px 12px 12px 16px;
}
.sidebar-head .brand {
  min-width: 0;
  gap: 12px;
}
.brand-copy {
  gap: 4px;
  line-height: 1.1;
}
.brand-copy strong {
  white-space: normal;
  line-height: 1.15;
}
.brand-copy small {
  margin-top: 1px;
  white-space: normal;
  line-height: 1.25;
}
.sidebar-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.07);
  font-size: 1.55rem;
  line-height: 1;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.sidebar-close:hover {
  color: #fff;
  background: rgba(255,255,255,.15);
  transform: translateX(-2px);
}
.sidebar-close span { transform: translateY(-1px); }
.menu {
  display: grid;
  margin-right: auto;
}
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main { margin-left: 0; }

/* Limpieza protegida de datos de prueba */
.danger-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 28px;
  align-items: center;
  max-width: 920px;
  margin-top: 20px;
  padding: 24px;
  border-color: rgba(180,35,24,.2);
  background: linear-gradient(120deg, #fff, #fff8f7);
}
.danger-zone h2 { margin: 5px 0 8px; }
.danger-zone p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.danger-zone form { display: grid; gap: 12px; }
.danger-zone label { display: grid; gap: 7px; font-size: .82rem; }
.danger-zone .danger-button:disabled {
  border-color: var(--line);
  color: #9b979f;
  background: #f1f1ef;
  cursor: not-allowed;
}

@media (max-width: 850px) {
  .sidebar { width: min(88vw, 296px); }
  .main { margin-left: 0; }
  .sidebar-head { min-height: 88px; }
  .danger-zone { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand-mark { width: 44px !important; height: 44px !important; }
  .brand-copy strong { font-size: .88rem; }
  .danger-zone { padding: 20px; }
}

/* Selección clara de módulos por usuario */
.user-form-panel { max-width: 980px; }
.permissions-field {
  margin: 4px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #f8faef, #f4f8ff);
  transition: opacity .2s ease, filter .2s ease;
}
.permissions-field legend {
  padding: 0 8px;
  color: var(--brand-ink);
  font-weight: 700;
}
.permissions-field > p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 400;
}
.permissions-field > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.permissions-field > div > div { min-width: 0; }
.permissions-field label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(61,91,179,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.82);
  font-size: .86rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.permissions-field label:hover {
  border-color: rgba(61,91,179,.34);
  background: #fff;
  transform: translateY(-1px);
}
.permissions-field input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand-blue);
}
.permissions-disabled { opacity: .55; filter: grayscale(.35); }
.permissions-disabled::after {
  content: "El administrador recibe acceso total automáticamente.";
  display: block;
  margin-top: 13px;
  color: var(--brand-green-dark);
  font-size: .8rem;
  font-weight: 600;
}
.modules-cell { min-width: 240px; max-width: 390px; color: var(--muted); font-size: .82rem; line-height: 1.45; }

@media (max-width: 650px) {
  .permissions-field > div { grid-template-columns: 1fr; }
  .permissions-field { padding: 16px; }
}

/* ================================================================
   EMNA Retail UI · catálogo visual inspirado en terminales POS
   ================================================================ */
:root {
  --retail-black: #17171a;
  --retail-paper: #ffffff;
  --retail-canvas: #f2f3f1;
  --retail-line: #e8e9e5;
  --retail-soft: #f7f8f5;
  --retail-shadow: 0 18px 50px rgba(30, 31, 35, .075);
}

body {
  background:
    radial-gradient(circle at 95% 0, rgba(128, 213, 31, .06), transparent 25rem),
    var(--retail-canvas);
}

.content { max-width: 1680px; }
.topbar {
  height: 70px;
  border-color: rgba(33, 21, 45, .075);
  background: rgba(255, 255, 255, .9);
}
.panel,
.stats article,
.form-panel,
.product-form-panel,
.record-form,
.setup-card,
.receipt,
.quote-document {
  border-color: var(--retail-line);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(30, 31, 35, .035);
}
.primary {
  border-color: var(--retail-black);
  background: linear-gradient(180deg, #2d2d31, var(--retail-black));
  box-shadow: 0 8px 18px rgba(23, 23, 26, .16);
}
.primary:hover {
  background: #09090b;
  box-shadow: 0 12px 24px rgba(23, 23, 26, .22);
}
.secondary,
.search button,
.camera-button,
.quote-status button {
  color: var(--retail-black);
  border-color: #caccc7;
}
.secondary:hover,
.search button:hover,
.camera-button:hover,
.quote-status button:hover {
  color: #fff;
  border-color: var(--retail-black);
  background: var(--retail-black);
}

/* Encabezado POS */
.pos-page-title {
  margin-bottom: 22px;
}
.pos-page-title h1 {
  margin: 5px 0 3px;
  font-size: clamp(1.85rem, 2.4vw, 2.55rem);
}
.pos-session-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--retail-line);
  border-radius: 999px;
  color: #62645f;
  background: rgba(255,255,255,.8);
  font-size: .78rem;
  font-weight: 650;
}
.pos-session-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 0 4px rgba(128, 213, 31, .14);
}

/* Área principal */
.pos-showcase {
  grid-template-columns: minmax(0, 1fr) minmax(345px, 420px);
  gap: 16px;
}
.pos-catalog {
  min-width: 0;
  padding: 24px;
  overflow: visible;
}
.catalog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.catalog-heading h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}
.catalog-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}
.catalog-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  color: #676862;
  background: var(--retail-soft);
  font-size: .72rem;
  font-weight: 650;
}

.barcode-zone.pos-toolbar {
  position: relative;
  top: auto;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  padding: 0;
  background: transparent;
}
.pos-toolbar .pos-search {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 50px;
  margin: 0;
  padding: 5px 6px 5px 14px;
  border-color: var(--retail-line);
  border-radius: 14px;
  box-shadow: none;
}
.pos-toolbar .pos-search:focus-within {
  border-color: #b9bcb5;
  box-shadow: 0 0 0 4px rgba(23, 23, 26, .045);
}
.search-symbol {
  color: #777a74;
  font-size: 1.45rem;
  line-height: 1;
  transform: rotate(-15deg);
}
.pos-toolbar .pos-search input {
  width: 100%;
  min-width: 0;
  padding: 8px 4px;
  font-size: .88rem;
}
.pos-toolbar .clear-search {
  min-height: 36px;
  padding: 0 13px;
  color: #777a74;
  border: 0;
  border-radius: 10px;
  background: var(--retail-soft);
  font-size: .76rem;
}
.pos-toolbar .clear-search:hover { color: var(--retail-black); background: #ebece8; }
.pos-scan-button {
  min-height: 50px;
  padding: 0 20px;
  color: #fff;
  border-color: var(--retail-black);
  border-radius: 14px;
  background: linear-gradient(180deg, #303034, var(--retail-black));
  box-shadow: 0 8px 18px rgba(23, 23, 26, .13);
}
.pos-scan-button:hover {
  color: #fff;
  background: #09090b;
  box-shadow: 0 12px 22px rgba(23, 23, 26, .2);
}
.pos-toolbar .scan-help {
  grid-column: 1 / -1;
  padding-left: 3px;
  font-size: .74rem;
}
.pos-toolbar .scan-feedback { grid-column: 1 / -1; margin-top: 0; }

/* Categorías */
.category-tabs {
  display: flex;
  gap: 5px;
  margin: 22px 0 16px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--retail-line);
  border-radius: 14px;
  background: var(--retail-soft);
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  min-height: 37px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #71736e;
  background: transparent;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s var(--ease-emna);
}
.category-tab:hover { color: var(--retail-black); }
.category-tab.active {
  color: var(--retail-black);
  background: #fff;
  box-shadow: 0 2px 10px rgba(23,23,26,.08);
}

/* Tarjetas de producto */
.pos-product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.pos-product-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 305px;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  overflow: hidden;
  border-color: var(--retail-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
  text-align: left;
}
.pos-product-card:hover {
  border-color: #d6d8d2;
  background: #fff;
  box-shadow: 0 18px 35px rgba(26, 28, 31, .09);
  transform: translateY(-5px);
}
.product-visual {
  position: relative;
  display: grid;
  width: 100%;
  height: 126px;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  color: var(--brand-blue-dark);
  background:
    radial-gradient(circle at 80% 16%, rgba(121,208,239,.28), transparent 34%),
    linear-gradient(145deg, #f0f4eb, #eef2fb);
}
.product-visual > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 61px;
  height: 61px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand-blue), var(--brand-blue-dark));
  box-shadow: 0 12px 25px rgba(61,91,179,.24);
  font-size: 1.6rem;
  font-weight: 750;
}
.product-visual img {
  position: absolute;
  right: -18px;
  bottom: -25px;
  width: 100px;
  opacity: .07;
  transform: rotate(-10deg);
}
.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 3px;
}
.pos-product-card .product-category {
  overflow: hidden;
  color: #71736e;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .045em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.stock-chip {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #4c7f1f;
  background: #f0f8e7;
  font-size: .6rem;
  font-weight: 700;
}
.pos-product-card > strong {
  display: -webkit-box;
  overflow: hidden;
  min-height: 41px;
  color: var(--retail-black);
  font-size: .92rem;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.pos-product-card > small {
  overflow: hidden;
  color: #858681;
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 5px;
}
.pos-product-card .product-footer b {
  color: var(--retail-black);
  font-size: 1.25rem;
  letter-spacing: -.035em;
}
.add-product {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(180deg, #303034, var(--retail-black));
  box-shadow: 0 7px 15px rgba(23,23,26,.18);
  font-size: 1.3rem;
  font-weight: 350;
  transition: transform .2s var(--ease-emna);
}
.pos-product-card:hover .add-product { transform: scale(1.06) rotate(2deg); }
.pos-empty {
  grid-column: 1 / -1;
  border: 1px dashed #d6d8d2;
  border-radius: 14px;
  background: var(--retail-soft);
}

/* Carrito */
.pos-cart {
  top: 86px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  border-radius: 20px;
  scrollbar-width: thin;
}
.cart-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 22px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.cart-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
}
#cart-count {
  display: inline-grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--retail-black);
  background: #eff6e8;
  font-size: .68rem;
}
.pos-cart-items { max-height: 280px; }
.pos-cart-items .empty {
  padding: 43px 24px;
  font-size: .82rem;
}
.pos-cart .cart-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 20px;
  border-color: var(--retail-line);
}
.pos-cart .cart-row > b {
  grid-column: 1;
  color: var(--retail-black);
  font-size: .86rem;
}
.pos-cart .cart-row .quantity {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.pos-cart .quantity button {
  width: 28px;
  height: 28px;
  border-color: #dedfdb;
  background: var(--retail-soft);
}
.pos-sale-fields {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 18px 20px;
  border-color: var(--retail-line);
}
.pos-sale-fields label {
  gap: 6px;
  color: #595b56;
  font-size: .72rem;
}
.pos-sale-fields input,
.pos-sale-fields select {
  min-height: 42px;
  border-color: var(--retail-line);
  background: var(--retail-soft);
  font-size: .82rem;
}
.pos-totals {
  gap: 10px;
  padding: 18px 20px;
  color: #747670;
  border-color: var(--retail-line);
  font-size: .82rem;
}
.pos-totals strong { color: var(--retail-black); }
.pos-totals .grand-total {
  order: 5;
  margin-top: 5px;
  padding-top: 15px;
  border-color: #d7d8d4;
  color: var(--retail-black);
  font-size: 1.2rem;
}
.pos-totals .grand-total strong { font-size: 1.5rem; }
.pos-checkout {
  display: flex;
  min-height: 52px;
  justify-content: space-between;
  border-radius: 14px;
}
.pos-checkout:disabled {
  border-color: #e3e4e0;
  color: #9a9b96;
  background: #eceDEA;
  box-shadow: none;
}
.checkout-note {
  margin: -6px 18px 18px;
  color: #92938f;
  font-size: .67rem;
  text-align: center;
}

/* Unifica el resto del sistema con el nuevo lenguaje */
.stats article,
.settings-links a {
  background: rgba(255,255,255,.92);
}
.stats article:hover,
.settings-links a:hover {
  border-color: #d8dad4;
  box-shadow: var(--retail-shadow);
}
table { background: #fff; }
th { background: var(--retail-soft); }
tbody tr:hover { background: #fafbf8; }
input,
select,
textarea,
.record-form input,
.record-form select {
  border-color: var(--retail-line);
}

@media (max-width: 1280px) {
  .pos-showcase { grid-template-columns: minmax(0, 1fr) 350px; }
  .pos-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .pos-showcase { grid-template-columns: 1fr; }
  .pos-cart { position: static; max-height: none; }
  .pos-sale-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .pos-page-title { align-items: flex-start; }
  .pos-session-pill { align-self: flex-start; }
  .pos-catalog { padding: 16px; border-radius: 16px; }
  .catalog-heading { align-items: flex-start; flex-direction: column; margin-bottom: 16px; }
  .barcode-zone.pos-toolbar { grid-template-columns: 1fr; }
  .pos-toolbar .pos-search { grid-template-columns: 22px minmax(0, 1fr); }
  .pos-toolbar .pos-search input { flex-basis: auto; }
  .pos-toolbar .clear-search { display: none; }
  .pos-scan-button { width: 100%; }
  .category-tabs { margin-top: 18px; }
  .pos-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .pos-product-card { min-height: 260px; padding: 8px; border-radius: 14px; }
  .product-visual { height: 104px; }
  .product-visual > span { width: 52px; height: 52px; border-radius: 15px; font-size: 1.35rem; }
  .product-meta { align-items: flex-start; flex-direction: column; }
  .stock-chip { display: none; }
  .pos-product-card > strong { min-height: 37px; font-size: .82rem; }
  .pos-product-card > small { font-size: .61rem; }
  .pos-product-card .product-footer b { font-size: 1.05rem; }
  .add-product { width: 34px; height: 34px; }
  .pos-cart { border-radius: 16px; }
  .pos-sale-fields { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .pos-product-grid { grid-template-columns: 1fr; }
  .pos-product-card { min-height: 285px; }
  .product-visual { height: 128px; }
}

/* Captura del código original del proveedor al crear productos */
.product-form-panel {
  max-width: 1000px;
}
.product-form-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--retail-line);
  background: linear-gradient(115deg, rgba(128,213,31,.1), rgba(121,208,239,.08), #fff);
}
.product-form-icon {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand-blue), var(--brand-blue-dark));
  box-shadow: 0 9px 18px rgba(61,91,179,.2);
  font-size: 1.2rem;
}
.product-form-intro > div:last-child { min-width: 0; }
.product-form-intro strong { color: var(--brand-ink); font-size: .9rem; }
.product-form-intro p { margin: 3px 0 0; color: var(--muted); font-size: .77rem; }
.barcode-form-field {
  display: grid;
  gap: 7px;
}
.barcode-form-field > label {
  color: #4d4e4a;
  font-size: .8rem;
  font-weight: 700;
}
.barcode-input-row {
  display: grid;
  grid-template-columns: minmax(180px,1fr) auto auto;
  gap: 8px;
}
.barcode-input-row input { width: 100%; }
.barcode-action {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 11px;
  white-space: nowrap;
}
.barcode-field-help {
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.45;
}
.barcode-form-field .scan-feedback {
  margin: 2px 0 0;
  font-size: .78rem;
}

@media (max-width: 720px) {
  .barcode-input-row { grid-template-columns: 1fr 1fr; }
  .barcode-input-row input { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
  .product-form-intro { align-items: flex-start; padding: 16px; }
  .barcode-input-row { grid-template-columns: 1fr; }
  .barcode-input-row input { grid-column: auto; }
  .barcode-action { width: 100%; }
}

/* Presentaciones y equivalencias de inventario */
.page-subtitle {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}
.presentations-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 20px;
  align-items: start;
}
.presentations-list,
.presentation-form-panel {
  overflow: hidden;
  border-radius: 20px;
}
.presentations-list .panel-head,
.presentation-form-panel .panel-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--retail-line);
}
.presentation-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--retail-line);
  transition: background .2s ease, transform .2s ease;
}
.presentation-card:hover { background: #fafcf8; }
.presentation-card:last-child { border-bottom: 0; }
.presentation-card h3 { margin: 6px 0 3px; color: var(--brand-ink); font-size: 1rem; }
.presentation-card p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.presentation-factor {
  display: grid;
  min-height: 62px;
  place-content: center;
  text-align: center;
  border: 1px solid #dfe7f6;
  border-radius: 16px;
  color: var(--brand-blue);
  background: linear-gradient(145deg, #f4f7ff, #fff);
}
.presentation-factor strong { font-size: 1.15rem; line-height: 1; }
.presentation-factor small { margin-top: 5px; color: var(--muted); font-size: .62rem; }
.base-presentation .presentation-factor {
  border-color: rgba(128, 213, 31, .3);
  color: #4c8d14;
  background: linear-gradient(145deg, rgba(128, 213, 31, .13), #fff);
}
.presentation-inactive { opacity: .62; }
.presentation-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 22px 24px 26px;
}
.presentation-form label { margin: 0; }
.presentation-form .wide-field,
.presentation-form .presentation-example,
.presentation-form > button { grid-column: 1 / -1; }
.presentation-example {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid rgba(128, 213, 31, .3);
  border-radius: 13px;
  color: #59604f;
  background: rgba(128, 213, 31, .08);
  font-size: .76rem;
  line-height: 1.45;
}
.presentation-example strong { color: #4d8618; }
.table-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 400;
}

@media (max-width: 1050px) {
  .presentations-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .presentation-card { grid-template-columns: 58px minmax(0, 1fr); padding: 15px 16px; }
  .presentation-card > a { grid-column: 2; }
  .presentation-form { grid-template-columns: 1fr; padding: 18px 16px 22px; }
  .presentation-form .wide-field,
  .presentation-form .presentation-example,
  .presentation-form > button { grid-column: auto; }
  .presentation-example { flex-direction: column; }
}
