:root {
  --ink: #16213e;
  --ink-2: #283659;
  --muted: #69728a;
  --line: #dce3ef;
  --paper: #ffffff;
  --canvas: #f3f6fb;
  --teal: #1746a2;
  --teal-dark: #10357e;
  --teal-soft: #e9f0ff;
  --amber: #ffd34e;
  --amber-soft: #fff5cf;
  --green: #16a47a;
  --red: #e14e4e;
  --red-soft: #ffeded;
  --coral: #ff7043;
  --sky: #40a9ff;
  --shadow: 0 10px 28px rgba(22, 33, 62, .08);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 76px;
  background: #fffdf8;
  border-bottom: 3px solid var(--ink);
}
.topbar-inner { max-width: 1360px; height: 100%; margin: auto; padding: 0 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; min-width: 250px; }
.brand img { width: 246px; height: 66px; object-fit: contain; object-position: left center; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-link { padding: 10px 11px; border-radius: 7px; color: var(--muted); font-size: 14px; font-weight: 700; transition: .18s ease; }
.nav-link:hover, .nav-link.active { color: var(--teal-dark); background: var(--teal-soft); }
.admin-link { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.admin-link:hover { border-color: var(--teal); }
.logout-link { color: #9d3f32; }
.user-chip { min-width: 118px; padding-left: 13px; border-left: 1px solid var(--line); display: flex; flex-direction: column; line-height: 1.15; }
.user-chip strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-chip small { margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }

.page { max-width: 1360px; margin: 0 auto; padding: 28px 24px 70px; }
.page-title { margin: 0; font-size: clamp(25px, 4vw, 39px); line-height: 1.08; letter-spacing: -.8px; }
.page-subtitle { margin: 9px 0 0; color: var(--muted); font-size: 15px; }
.eyebrow { margin: 0 0 9px; color: var(--teal-dark); font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 800; }

.work-header { min-height: 156px; padding: 27px 29px; border: 1px solid #dce3ef; border-left: 8px solid var(--coral); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.work-header h1 { margin: 0; font-size: clamp(29px,4vw,43px); letter-spacing: -1.2px; }
.work-header p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); }
.shift-total { min-width: 240px; padding-left: 28px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.shift-total span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; }
.shift-total strong { margin: 8px 0 4px; font-size: 31px; }
.shift-total small { color: var(--muted); font-size: 12px; }

.hero {
  min-height: 275px;
  padding: 34px;
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 30px;
  align-items: center;
  color: #fff;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--ink);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  border: 68px solid rgba(255,255,255,.06);
}
.hero-content { position: relative; z-index: 1; max-width: 740px; }
.hero .eyebrow { color: #80d8d2; }
.hero h1 { margin: 0; max-width: 700px; font-size: clamp(31px, 5vw, 52px); line-height: 1.04; letter-spacing: -1.8px; }
.hero p { margin: 17px 0 0; color: rgba(255,255,255,.74); font-size: 16px; max-width: 630px; }
.hero-actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-side { position: relative; z-index: 2; background: rgba(255,255,255,.1); padding: 20px; border: 1px solid rgba(255,255,255,.14); border-radius: 20px; backdrop-filter: blur(8px); }
.live-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #75e0ae; box-shadow: 0 0 0 5px rgba(117,224,174,.13); }
.hero-total { margin: 14px 0 4px; font-size: 35px; font-weight: 800; }
.hero-side small { color: rgba(255,255,255,.66); }

.btn { min-height: 44px; border: 0; border-radius: 8px; padding: 11px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 800; font-size: 14px; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: var(--teal); box-shadow: 0 8px 18px rgba(16,133,138,.2); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-amber { color: #222; background: var(--amber); }
.btn-light { color: var(--ink); background: #fff; }
.btn-outline { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.btn-danger { color: #fff; background: var(--red); }
.btn-sm { min-height: 36px; padding: 8px 12px; font-size: 12px; border-radius: 9px; }
.btn-icon { width: 42px; padding: 0; }

.section-head { margin: 30px 0 15px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.section-head h2 { margin: 0; font-size: 21px; letter-spacing: -.3px; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 13px; }
.action-card { min-height: 142px; padding: 21px; border: 1px solid var(--line); border-top: 4px solid var(--teal); border-radius: 9px; background: var(--paper); transition: .16s ease; }
.action-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.action-icon { width: auto; height: auto; display: block; color: var(--teal-dark); font-size: 11px; letter-spacing: 1.5px; font-weight: 900; }
.action-card.amber { border-top-color: var(--coral); }
.action-card.amber .action-icon { background: transparent; color: #a9432d; }
.action-card h3 { margin: 16px 0 5px; font-size: 17px; }
.action-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.metric-value { margin-top: 9px; font-size: 28px; line-height: 1; font-weight: 850; letter-spacing: -.8px; }
.metric-note { margin-top: 9px; color: var(--muted); font-size: 12px; }
.metric-mark { width: 11px; height: 11px; border-radius: 50%; background: var(--teal); }
.metric-mark.amber { background: var(--amber); }
.metric-mark.red { background: var(--red); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.panel-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 18px; }
.panel-body { padding: 22px; }
.two-col { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 18px; }
.stack { display: grid; gap: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.field { grid-column: span 6; }
.field.third { grid-column: span 4; }
.field.quarter { grid-column: span 3; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; margin: 0 0 7px; color: var(--ink-2); font-size: 12px; font-weight: 800; }
.control { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid #cfd6dc; border-radius: 11px; outline: none; background: #fff; color: var(--ink); transition: .16s; }
.control:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(16,133,138,.11); }
.control-lg { min-height: 57px; font-size: 18px; font-weight: 750; }
.input-row { display: flex; gap: 10px; }
.input-row .control { flex: 1; min-width: 0; }
.hint { margin-top: 6px; color: var(--muted); font-size: 12px; }

.scan-box { padding: 23px; border: 2px solid #bfd0c9; border-radius: 10px; background: #f7faf7; }
.scan-status { min-height: 72px; margin-top: 15px; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 13px; background: #fff; border: 1px solid var(--line); }
.scan-product { font-weight: 800; }
.scan-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }

.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { padding: 12px 15px; text-align: left; color: var(--muted); background: #f8f9f8; border-bottom: 1px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: .55px; white-space: nowrap; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid #edf0f2; font-size: 13px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.td-main { font-weight: 760; }
.td-sub { margin-top: 3px; color: var(--muted); font-size: 11px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.empty { padding: 44px 20px; color: var(--muted); text-align: center; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px; background: #edf1f3; color: var(--ink-2); font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.ok { color: #126c49; background: #e4f5ed; }
.badge.warn { color: #91560f; background: var(--amber-soft); }
.badge.danger { color: #a33131; background: var(--red-soft); }
.stock-low { color: var(--red); font-weight: 850; }

.cart-total { padding: 18px 21px; display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: #fff; border-radius: 15px; }
.cart-total span { font-size: 13px; color: rgba(255,255,255,.66); }
.cart-total strong { font-size: 30px; letter-spacing: -.7px; }
.cart-qty { width: 82px; min-height: 36px; text-align: center; }
.remove-item { border: 0; color: var(--red); background: var(--red-soft); width: 31px; height: 31px; border-radius: 9px; cursor: pointer; font-weight: 900; }

.alert { margin-bottom: 18px; padding: 13px 16px; border-radius: 12px; border: 1px solid transparent; font-size: 13px; font-weight: 680; }
.alert.success { color: #126c49; background: #e9f7f0; border-color: #bfe3d2; }
.alert.error { color: #9d3030; background: #fdeeee; border-color: #efc7c7; }
.alert.info { color: #155c75; background: #e9f4f8; border-color: #c6e0e9; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 390px; padding: 15px 18px; border-radius: 13px; color: #fff; background: var(--ink); box-shadow: 0 16px 45px rgba(0,0,0,.22); opacity: 0; transform: translateY(16px); pointer-events: none; transition: .22s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a93838; }
.toast.success { background: #13704b; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; color: #fff; background: var(--ink); border-right: 6px solid var(--coral); overflow: auto; }
.sidebar-logo { padding: 0 7px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-logo img { width: 190px; filter: brightness(0) invert(1); }
.sidebar-section { margin: 23px 10px 8px; color: rgba(255,255,255,.42); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; }
.side-link { margin: 3px 0; padding: 11px 12px; border-radius: 10px; display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.72); font-size: 13px; font-weight: 720; }
.side-link:hover, .side-link.active { color: #fff; background: rgba(255,255,255,.1); }
.side-icon { width: 21px; text-align: center; color: #79d5d0; }
.admin-main { min-width: 0; }
.admin-top { height: 70px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #fff; border-bottom: 1px solid var(--line); }
.admin-top strong { font-size: 14px; }
.admin-top-left { display: flex; align-items: center; gap: 12px; }
.admin-top-left > div { display: flex; flex-direction: column; }
.admin-top-left small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.admin-content { padding: 26px 28px 60px; max-width: 1500px; }
.admin-heading { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.admin-heading h1 { margin: 0; font-size: 29px; letter-spacing: -.6px; }
.admin-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.mobile-menu { display: none; }

.chart { height: 210px; padding: 15px 10px 0; display: flex; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--line); }
.chart-col { flex: 1; height: 100%; min-width: 32px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.chart-value { font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart-bar { width: min(42px, 74%); min-height: 3px; border-radius: 3px 3px 0 0; background: var(--teal); }
.chart-label { margin-bottom: -30px; padding-top: 6px; font-size: 10px; color: var(--muted); text-transform: capitalize; }
.chart + .chart-spacer { height: 30px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(320px,.9fr) minmax(430px,1.1fr); background: #fff; }
.login-brand { padding: 55px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: var(--ink); border-top: 12px solid var(--coral); }
.login-brand img { width: 280px; filter: brightness(0) invert(1); }
.login-copy { max-width: 530px; }
.login-copy h1 { margin: 0; font-size: clamp(35px, 5vw, 62px); line-height: 1.02; letter-spacing: -2px; }
.login-copy p { color: rgba(255,255,255,.68); line-height: 1.6; }
.login-form-area { padding: 40px; display: grid; place-items: center; background: var(--canvas); }
.login-card { width: min(430px, 100%); padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-size: 27px; }
.login-card > p { margin: 8px 0 24px; color: var(--muted); font-size: 14px; }
.login-card .field { margin-bottom: 15px; }
.login-card .btn { width: 100%; margin-top: 5px; }
.login-back { display: block; margin-top: 17px; color: var(--teal-dark); text-align: center; font-size: 13px; font-weight: 750; }

.footer { padding: 25px 24px; color: var(--muted); text-align: center; font-size: 12px; }
.hide { display: none !important; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.narrow { max-width: 760px; }
.install-logo { width: 250px; }
.install-list { padding-left: 20px; color: var(--muted); line-height: 1.7; }
.check-row { display: inline-flex !important; align-items: center; gap: 9px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--teal); }
.filter-grid { display: grid; grid-template-columns: minmax(180px,1.4fr) minmax(170px,1fr) 145px 145px auto; gap: 10px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.audit-table { min-width: 980px; }

@media (max-width: 1050px) {
  .main-nav .nav-link:not(.admin-link):not(.logout-link) { display: none; }
  .action-grid, .metrics { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 80; left: -270px; width: 248px; transition: left .22s; box-shadow: 12px 0 35px rgba(0,0,0,.22); }
  .sidebar.open { left: 0; }
  .mobile-menu { display: inline-flex; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { min-height: 320px; padding: 35px; }
  .login-copy h1 { font-size: 42px; }
  .login-form-area { padding: 35px 20px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .topbar { height: 66px; }
  .topbar-inner { padding: 0 15px; }
  .brand { min-width: 0; }
  .brand img { width: 190px; height: 55px; }
  .admin-link { padding: 9px 10px; font-size: 12px; }
  .user-chip { display: none; }
  .page { padding: 18px 14px 52px; }
  .hero { min-height: 0; padding: 25px 21px; grid-template-columns: 1fr; border-radius: 20px; }
  .hero h1 { font-size: 34px; letter-spacing: -1.2px; }
  .hero-side { display: none; }
  .action-grid, .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .action-card { min-height: 139px; padding: 17px; }
  .action-card p { font-size: 12px; }
  .metric { padding: 16px; }
  .metric-value { font-size: 22px; }
  .panel-body, .panel-head { padding: 17px; }
  .field, .field.third, .field.quarter { grid-column: 1 / -1; }
  .input-row { flex-wrap: wrap; }
  .input-row .btn { width: 100%; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .work-header { padding: 22px; align-items: flex-start; flex-direction: column; }
  .shift-total { width: 100%; min-width: 0; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .admin-top { height: 62px; padding: 0 15px; }
  .admin-content { padding: 19px 14px 50px; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .login-brand { min-height: 255px; padding: 27px; }
  .login-brand img { width: 210px; }
  .login-copy h1 { font-size: 34px; }
  .login-copy p { font-size: 14px; }
  .login-card { padding: 25px 21px; }
  .toast { left: 14px; right: 14px; bottom: 14px; }
  .filter-grid { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .action-grid, .metrics { grid-template-columns: 1fr; }
  .action-card { min-height: 0; }
  .hero-actions .btn { width: 100%; }
}

@media print {
  .topbar, .sidebar, .admin-top, .no-print, .footer { display: none !important; }
  body { background: #fff; }
  .page, .admin-content { padding: 0; }
  .panel { border: 0; box-shadow: none; }
}

/* Caja v6: interfaz directa para vendedor, pistola y pantallas táctiles. */
.role-seller { min-height: 100vh; background: #f3f6fb; }
.seller-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: 72px;
  padding: 0 max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #fff;
  border-bottom: 1px solid #dce3ef;
}
.seller-brand { width: 218px; flex: 0 0 auto; }
.seller-brand img { width: 100%; height: 60px; object-fit: contain; object-position: left center; }
.seller-top-actions { display: flex; align-items: center; gap: 14px; }
.seller-desktop-nav { display: flex; align-items: center; gap: 4px; margin-right: 8px; }
.seller-desktop-nav a { padding: 10px 13px; border-radius: 10px; color: #69728a; font-size: 13px; font-weight: 750; }
.seller-desktop-nav a:hover, .seller-desktop-nav a.active { color: #1746a2; background: #edf3ff; }
.open-register { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 999px; color: #08745a; background: #e7f8f2; font-size: 12px; font-weight: 800; }
.open-register i { width: 8px; height: 8px; border-radius: 50%; background: #16a47a; box-shadow: 0 0 0 4px rgba(22,164,122,.13); }
.seller-name { color: #283659; font-size: 13px; font-weight: 750; }
.seller-exit { padding: 9px 12px; border: 1px solid #dce3ef; border-radius: 10px; color: #c33d3d; font-size: 12px; font-weight: 800; }
.seller-exit:hover { border-color: #f0bcbc; background: #fff2f2; }
.role-seller .page { max-width: 1480px; padding: 26px 28px 70px; }

.pos-heading { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.pos-kicker { display: block; margin-bottom: 6px; color: #1746a2; font-size: 11px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; }
.pos-heading h1 { margin: 0; color: #16213e; font-size: clamp(28px,3vw,38px); line-height: 1; letter-spacing: -1px; }
.pos-heading p { margin: 8px 0 0; color: #69728a; font-size: 14px; }
.pos-heading-links { display: flex; gap: 9px; }
.pos-heading-links a { min-height: 40px; padding: 10px 14px; border: 1px solid #d6dfed; border-radius: 11px; display: inline-flex; align-items: center; color: #283659; background: #fff; font-size: 12px; font-weight: 800; }
.pos-heading-links a:hover { color: #1746a2; border-color: #9eb8eb; }

.pos-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(330px,385px); gap: 18px; align-items: start; }
.pos-workspace { min-width: 0; display: grid; gap: 16px; }
.scanner-card { position: relative; padding: 19px; border-radius: 18px; color: #fff; background: #1746a2; box-shadow: 0 14px 30px rgba(23,70,162,.17); overflow: hidden; }
.scanner-card::after { content: ""; position: absolute; top: 0; right: 0; width: 88px; height: 8px; border-radius: 0 0 0 8px; background: #ff7043; }
.scanner-label { margin-bottom: 13px; display: flex; align-items: center; gap: 11px; }
.scanner-label > div { min-width: 0; display: flex; flex-direction: column; }
.scanner-label strong { font-size: 14px; }
.scanner-label small { margin-top: 3px; color: rgba(255,255,255,.72); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.scanner-icon { position: relative; width: 34px; height: 34px; flex: 0 0 auto; border: 2px solid rgba(255,255,255,.68); border-radius: 9px; }
.scanner-icon::before { content: ""; position: absolute; inset: 8px 7px; background: repeating-linear-gradient(90deg,#fff 0 2px,transparent 2px 4px,#fff 4px 5px,transparent 5px 8px); }
.scanner-icon::after { content: ""; position: absolute; left: 4px; right: 4px; top: 15px; height: 2px; background: #ffcf45; }
.scanner-input-row { position: relative; z-index: 1; display: flex; gap: 10px; }
.scanner-input { min-width: 0; width: 100%; height: 64px; padding: 0 20px; border: 3px solid transparent; border-radius: 14px; outline: none; color: #16213e; background: #fff; font-size: 24px; font-weight: 800; letter-spacing: .4px; box-shadow: 0 6px 14px rgba(4,24,65,.12); }
.scanner-input::placeholder { color: #8f9ab1; font-weight: 650; }
.scanner-input:focus { border-color: #ffd34e; box-shadow: 0 0 0 5px rgba(255,211,78,.21); }
.scanner-button { min-width: 126px; padding: 0 20px; border: 0; border-radius: 14px; color: #16213e; background: #ffd34e; cursor: pointer; font-size: 14px; font-weight: 900; }
.scanner-button:hover { background: #ffca20; }

.sale-list { min-height: 365px; border: 1px solid #dce3ef; border-radius: 18px; background: #fff; overflow: hidden; }
.sale-list-head { min-height: 66px; padding: 14px 18px; border-bottom: 1px solid #e6ebf3; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sale-list-head > div { display: flex; align-items: baseline; gap: 10px; }
.sale-list-head h2 { margin: 0; color: #16213e; font-size: 18px; }
.sale-list-head span { color: #69728a; font-size: 12px; font-weight: 750; }
.clear-sale { padding: 8px 10px; border: 0; border-radius: 9px; color: #c13c3c; background: #fff0f0; cursor: pointer; font-size: 11px; font-weight: 800; }
.clear-sale:disabled { opacity: .38; cursor: default; }
.sale-table { min-width: 650px; }
.sale-table th { padding: 11px 15px; background: #f7f9fc; }
.sale-table td { padding: 13px 15px; }
.sale-table .cart-qty { min-height: 40px; border-radius: 9px; font-weight: 800; }
.sale-empty { height: 240px; }
.sale-empty strong, .sale-empty small { display: block; }
.sale-empty strong { margin-top: 12px; color: #34405e; font-size: 15px; }
.sale-empty small { margin-top: 5px; color: #8a93a6; }
.empty-basket { position: relative; width: 58px; height: 42px; margin: 0 auto; display: block; border: 3px solid #c5cede; border-top: 0; border-radius: 0 0 14px 14px; }
.empty-basket::before { content: ""; position: absolute; left: 7px; right: 7px; top: -12px; height: 18px; border: 3px solid #c5cede; border-bottom: 0; border-radius: 20px 20px 0 0; }

.checkout-card { position: sticky; top: 90px; border: 1px solid #dce3ef; border-radius: 20px; background: #fff; box-shadow: 0 14px 36px rgba(22,33,62,.09); overflow: hidden; }
.checkout-total { padding: 22px 22px 20px; color: #fff; background: #16213e; }
.checkout-total span, .checkout-total small { display: block; }
.checkout-total span { color: #ffd34e; font-size: 12px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; }
.checkout-total strong { display: block; margin: 8px 0 5px; font-size: clamp(37px,4vw,48px); line-height: 1; letter-spacing: -1.8px; font-variant-numeric: tabular-nums; }
.checkout-total small { color: rgba(255,255,255,.58); font-size: 11px; }
.checkout-form { padding: 19px; display: grid; gap: 14px; }
.checkout-form .field label, .cash-box > label { display: block; margin-bottom: 7px; color: #34405e; font-size: 12px; font-weight: 850; }
.payment-select { min-height: 54px; border-width: 2px; border-radius: 12px; font-size: 16px; font-weight: 750; }
.cash-box { padding: 14px; border-radius: 14px; background: #fff7d8; }
.money-input { min-height: 53px; border: 2px solid #e7cf72; background: #fff; font-size: 19px; font-weight: 850; }
.change-row { margin-top: 11px; display: flex; align-items: center; justify-content: space-between; color: #6c5a17; }
.change-row span { font-size: 12px; font-weight: 750; }
.change-row strong { font-size: 22px; }
.sale-note-box { border-top: 1px solid #e5eaf2; padding-top: 11px; }
.sale-note-box summary { color: #58627a; cursor: pointer; font-size: 12px; font-weight: 800; }
.sale-note-box .control { margin-top: 9px; }
.complete-sale { width: 100%; min-height: 72px; padding: 12px 18px; border: 0; border-radius: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; background: #ff7043; cursor: pointer; box-shadow: 0 10px 22px rgba(255,112,67,.23); }
.complete-sale span { font-size: 20px; font-weight: 950; letter-spacing: .7px; }
.complete-sale small { margin-top: 3px; color: rgba(255,255,255,.78); font-size: 10px; font-weight: 700; }
.complete-sale:hover { background: #ee5d31; }
.complete-sale:disabled { color: #929bae; background: #e7ebf2; box-shadow: none; cursor: not-allowed; }
.checkout-security { padding: 11px 17px; border-top: 1px solid #e5eaf2; display: flex; align-items: center; gap: 8px; color: #69728a; background: #f8fafc; font-size: 10px; }
.checkout-security span { width: 19px; height: 19px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; background: #16a47a; font-weight: 900; }
.seller-bottom-nav { display: none; }

@media (max-width: 980px) {
  .seller-name { display: none; }
  .pos-layout { grid-template-columns: minmax(0,1fr) 330px; }
}

@media (max-width: 800px) {
  .role-seller { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .seller-topbar { min-height: 64px; padding-left: 14px; padding-right: 12px; }
  .seller-brand { width: 174px; }
  .seller-brand img { height: 53px; }
  .seller-desktop-nav, .open-register { display: none; }
  .seller-top-actions { gap: 7px; }
  .seller-exit { padding: 8px 10px; }
  .role-seller .page { padding: 17px 13px 28px; }
  .pos-heading { margin-bottom: 13px; align-items: center; }
  .pos-heading h1 { font-size: 26px; }
  .pos-heading p, .pos-heading-links { display: none; }
  .pos-layout { grid-template-columns: 1fr; gap: 13px; }
  .scanner-card { padding: 14px; border-radius: 16px; }
  .scanner-label { margin-bottom: 10px; }
  .scanner-input { height: 58px; padding: 0 15px; font-size: 20px; }
  .scanner-button { min-width: 94px; padding: 0 12px; }
  .sale-list { min-height: 250px; border-radius: 16px; }
  .sale-list-head { min-height: 58px; padding: 11px 14px; }
  .sale-table-wrap { overflow: visible; }
  .sale-table, .sale-table tbody { min-width: 0; width: 100%; display: block; }
  .sale-table thead { display: none; }
  .sale-table tbody tr:not(.cart-empty-row) { padding: 13px 14px; border-bottom: 1px solid #e9edf4; display: grid; grid-template-columns: minmax(0,1fr) 90px 38px; gap: 9px 12px; align-items: center; }
  .sale-table tbody tr:last-child { border-bottom: 0; }
  .sale-table td { padding: 0; border: 0; display: block; }
  .sale-table td:nth-child(1) { grid-column: 1 / 3; }
  .sale-table td:nth-child(2) { display: none; }
  .sale-table td:nth-child(3) { grid-column: 1; }
  .sale-table td:nth-child(3)::before { content: "Cantidad"; margin-bottom: 4px; display: block; color: #8a93a6; font-size: 9px; font-weight: 850; text-transform: uppercase; }
  .sale-table td:nth-child(4) { grid-column: 2; align-self: end; font-size: 17px; }
  .sale-table td:nth-child(4)::before { content: "Subtotal"; margin-bottom: 6px; display: block; color: #8a93a6; font-size: 9px; font-weight: 850; text-transform: uppercase; }
  .sale-table td:nth-child(5) { grid-column: 3; grid-row: 1; }
  .sale-table .cart-qty { width: 100%; }
  .cart-empty-row { display: table-row; }
  .sale-empty { width: 100%; height: 190px; }
  .checkout-card { position: static; border-radius: 16px; }
  .checkout-total { padding: 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; }
  .checkout-total span { grid-column: 1; }
  .checkout-total strong { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 38px; }
  .checkout-total small { grid-column: 1; }
  .checkout-form { padding: 15px; }
  .seller-bottom-nav { position: fixed; z-index: 70; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); min-height: 62px; padding: 6px; border: 1px solid #dce3ef; border-radius: 18px; display: grid; grid-template-columns: repeat(3,1fr); background: #fff; box-shadow: 0 12px 34px rgba(22,33,62,.2); }
  .seller-bottom-nav a { border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #7b8499; font-size: 9px; font-weight: 800; }
  .seller-bottom-nav a span { font-size: 22px; line-height: 1; }
  .seller-bottom-nav a.active { color: #fff; background: #1746a2; }
  .role-seller .footer { display: none; }
}

@media (max-width: 430px) {
  .scanner-input-row { gap: 7px; }
  .scanner-button { min-width: 78px; font-size: 12px; }
  .scanner-input { font-size: 18px; }
  .checkout-total strong { font-size: 33px; }
}

@media print {
  .seller-topbar, .seller-bottom-nav, .pos-heading-links { display: none !important; }
}

/* Identidad v7 · A&J más viva, directa y reconocible. */
:root {
  --ink: #20233c;
  --ink-2: #343755;
  --muted: #73758b;
  --line: #e5e2f2;
  --canvas: #f7f6ff;
  --teal: #6c4cf1;
  --teal-dark: #5537d8;
  --teal-soft: #eeeaff;
  --amber: #ffca3a;
  --amber-soft: #fff6d5;
  --green: #13b8a6;
  --red: #ee4f6a;
  --red-soft: #fff0f3;
  --coral: #ff5c77;
  --sky: #41a7ff;
  --shadow: 0 16px 40px rgba(63, 48, 135, .10);
  --radius: 18px;
}

body {
  background:
    radial-gradient(circle at 4% 12%, rgba(108,76,241,.08), transparent 23rem),
    radial-gradient(circle at 96% 78%, rgba(19,184,166,.07), transparent 22rem),
    var(--canvas);
}

.btn { border-radius: 12px; }
.btn-primary { background: linear-gradient(135deg, #7454f4, #5b3cdd); box-shadow: 0 9px 22px rgba(108,76,241,.22); }
.btn-primary:hover { background: linear-gradient(135deg, #6847ec, #5032ca); }
.control { border-color: #dcd8eb; border-radius: 13px; }
.control:focus { border-color: #6c4cf1; box-shadow: 0 0 0 4px rgba(108,76,241,.12); }
.badge.ok { color: #087a6d; background: #e5faf6; }
.badge.warn { color: #8c6600; }
.metric-mark, .chart-bar { background: #6c4cf1; }

.topbar { border-bottom: 0; box-shadow: 0 5px 22px rgba(46,39,92,.08); }
.nav-link:hover, .nav-link.active { color: #5638d7; background: #eeeaff; }
.work-header { border: 0; border-left: 8px solid #ff5c77; border-radius: 20px; box-shadow: var(--shadow); }
.panel, .metric, .action-card { border-color: #e7e3f2; }
.metric, .action-card { border-radius: 16px; }
.action-card { border-top-color: #6c4cf1; }
.action-card.amber { border-top-color: #ff5c77; }

.sidebar { background: #28233f; border-right-color: #ffca3a; }
.sidebar-logo { margin: -6px -2px 20px; padding: 10px 12px; border: 0; border-radius: 16px; background: #fff; }
.sidebar-logo img { width: 198px; filter: none; }
.side-link:hover, .side-link.active { background: #6c4cf1; }
.side-icon { color: #6fe0d2; }

.login-page { background: #f7f6ff; }
.login-brand {
  position: relative;
  overflow: hidden;
  border-top: 0;
  background: linear-gradient(145deg, #28233f 0%, #5b3cdd 68%, #6c4cf1 100%);
}
.login-brand::before, .login-brand::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-brand::before { width: 310px; height: 310px; right: -100px; top: -90px; background: #ffca3a; opacity: .96; }
.login-brand::after { width: 180px; height: 180px; right: 18%; bottom: -105px; background: #13b8a6; }
.login-brand > * { position: relative; z-index: 1; }
.login-brand > img { width: 315px; padding: 10px 14px; border-radius: 18px; background: #fff; filter: none; box-shadow: 0 14px 35px rgba(16,12,40,.18); }
.login-brand .eyebrow { color: #ffdc72; }
.login-copy h1 { letter-spacing: -2.8px; }
.login-card { border: 0; border-radius: 22px; box-shadow: 0 24px 70px rgba(57,42,124,.13); }
.login-card h2::after { content: ""; width: 42px; height: 6px; margin-top: 12px; border-radius: 9px; display: block; background: linear-gradient(90deg,#6c4cf1 0 45%,#13b8a6 45% 70%,#ffca3a 70%); }

.role-seller {
  background:
    radial-gradient(circle at 0 22%, rgba(108,76,241,.10), transparent 25rem),
    radial-gradient(circle at 100% 92%, rgba(255,92,119,.08), transparent 25rem),
    #f8f7fc;
}
.seller-topbar { border: 0; box-shadow: 0 6px 25px rgba(50,39,105,.08); }
.seller-brand { width: 230px; }
.seller-desktop-nav a:hover, .seller-desktop-nav a.active { color: #593bdc; background: #eeeaff; }
.open-register { color: #08786b; background: #e3faf5; }
.open-register i { background: #13b8a6; box-shadow: 0 0 0 4px rgba(19,184,166,.14); }
.seller-exit { border-color: #ebe5ef; color: #d4405c; }
.pos-kicker { color: #6c4cf1; }
.pos-heading h1 { color: #20233c; }
.pos-heading-links a { border-color: #ded9ec; border-radius: 13px; box-shadow: 0 5px 14px rgba(52,42,98,.04); }
.pos-heading-links a:hover { color: #5b3cdd; border-color: #b9adf4; }

.scanner-card {
  border-radius: 23px;
  background: linear-gradient(125deg, #6040e5 0%, #7454f4 62%, #8267f6 100%);
  box-shadow: 0 18px 42px rgba(92,61,220,.23);
}
.scanner-card::before { content: ""; position: absolute; width: 150px; height: 150px; right: -45px; bottom: -90px; border: 28px solid rgba(255,255,255,.08); border-radius: 50%; }
.scanner-card::after { width: 105px; height: 9px; background: linear-gradient(90deg,#13b8a6 0 35%,#ffca3a 35% 70%,#ff5c77 70%); }
.scanner-icon { border-color: rgba(255,255,255,.82); background: rgba(255,255,255,.09); }
.scanner-icon::after { background: #ffca3a; animation: scanner-line 1.8s ease-in-out infinite; }
.scanner-input { border-radius: 16px; color: #20233c; box-shadow: 0 8px 22px rgba(34,22,92,.16); }
.scanner-input:focus { border-color: #ffca3a; box-shadow: 0 0 0 5px rgba(255,202,58,.22), 0 8px 22px rgba(34,22,92,.16); }
.scanner-button { border-radius: 16px; background: #ffca3a; box-shadow: 0 8px 18px rgba(66,45,6,.13); }
.scanner-button:hover { background: #ffd45d; transform: translateY(-1px); }
@keyframes scanner-line { 0%,100% { transform: translateY(-7px); } 50% { transform: translateY(7px); } }

.sale-list { border-color: #e7e2f2; border-radius: 22px; box-shadow: 0 12px 32px rgba(58,45,116,.07); }
.sale-list-head { border-color: #eeeaf6; }
.clear-sale { color: #d73e59; background: #fff0f3; }
.sale-table th { background: #faf9fe; }
.sale-table tbody tr { transition: background .15s ease; }
.sale-table tbody tr:hover { background: #faf9ff; }
.empty-basket { border-color: #c8bff3; }
.empty-basket::before { border-color: #c8bff3; }
.remove-item { color: #d93e5a; background: #fff0f3; }

.checkout-card { border: 0; border-radius: 23px; box-shadow: 0 18px 48px rgba(53,39,113,.13); }
.checkout-total { position: relative; overflow: hidden; background: linear-gradient(125deg,#28233f,#39325c); }
.checkout-total::after { content: ""; position: absolute; width: 92px; height: 92px; right: -30px; top: -40px; border-radius: 50%; background: #13b8a6; opacity: .22; }
.checkout-total span { color: #ffdc72; }
.cash-box { background: #fff8db; }
.money-input { border-color: #ead47b; }
.complete-sale { border-radius: 17px; background: linear-gradient(135deg,#ff5c77,#f44562); box-shadow: 0 13px 28px rgba(244,69,98,.25); transition: transform .16s ease, box-shadow .16s ease; }
.complete-sale:hover { background: linear-gradient(135deg,#ff6d85,#ed3857); transform: translateY(-2px); box-shadow: 0 16px 31px rgba(244,69,98,.30); }
.complete-sale:disabled { background: #e7e4ee; transform: none; }
.checkout-security span { background: #13b8a6; }
.toast { border-radius: 16px; background: #28233f; }
.toast.success { background: #087d70; }

@media (max-width: 800px) {
  .seller-brand { width: 185px; }
  .seller-bottom-nav { border: 0; box-shadow: 0 14px 38px rgba(50,38,106,.22); }
  .seller-bottom-nav a.active { background: linear-gradient(135deg,#7454f4,#5b3cdd); box-shadow: 0 7px 15px rgba(108,76,241,.25); }
  .scanner-card, .sale-list, .checkout-card { border-radius: 19px; }
}

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