/* TiendaPOS — estilos propios sobre Bootstrap 5.3 */
:root {
  /* Paleta sobria inspirada en el diseño de Apple: grises neutros, azul de acento y colores de sistema */
  --tp-primary: #0071e3;
  --tp-primary-600: #0062c4;
  --tp-primary-soft: #e8f1fc;
  --tp-accent: #ff9f0a;
  --tp-bg: #f5f5f7;
  --tp-surface: #ffffff;
  --tp-border: #e5e5ea;
  --tp-text-soft: #6e6e73;
  --tp-ok: #248a3d; --tp-ok-soft: #e6f6ea;
  --tp-warn: #b25000; --tp-warn-soft: #fff3e0;
  --tp-bad: #d70015; --tp-bad-soft: #ffe9ea;
  --tp-sidebar-w: 236px;
  --tp-topbar-h: 56px;
  --bs-primary: var(--tp-primary);
  --bs-primary-rgb: 0, 113, 227;
  --bs-body-bg: var(--tp-bg);
  --bs-body-color: #1d1d1f;
  --bs-border-color: var(--tp-border);
  --bs-link-color: var(--tp-primary);
  --bs-link-hover-color: var(--tp-primary-600);
  --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
}
[data-bs-theme="dark"] {
  --tp-primary: #0a84ff;
  --tp-primary-600: #409cff;
  --tp-primary-soft: #0c2a4a;
  --tp-accent: #ff9f0a;
  --tp-bg: #000000;
  --tp-surface: #1c1c1e;
  --tp-border: #38383a;
  --tp-text-soft: #98989d;
  --tp-ok: #30d158; --tp-ok-soft: #12301a;
  --tp-warn: #ffb340; --tp-warn-soft: #3a2a0a;
  --tp-bad: #ff453a; --tp-bad-soft: #3d1614;
  --bs-primary-rgb: 10, 132, 255;
  --bs-body-bg: var(--tp-bg);
  --bs-body-color: #f5f5f7;
  --bs-border-color: var(--tp-border);
}
body { background: var(--tp-bg); -webkit-font-smoothing: antialiased; letter-spacing: -.003em; }
h1, h2, h3, .h1, .h2, .h3, .h4, .h5 { letter-spacing: -.02em; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--tp-primary); --bs-btn-border-color: var(--tp-primary); --bs-btn-hover-bg: var(--tp-primary-600); --bs-btn-hover-border-color: var(--tp-primary-600); --bs-btn-active-bg: var(--tp-primary-600); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
.btn-primary { --bs-btn-disabled-bg: var(--tp-primary); --bs-btn-disabled-border-color: var(--tp-primary); --bs-btn-focus-shadow-rgb: 0, 113, 227; border-radius: .65rem; font-weight: 500; }
.btn { border-radius: .65rem; }
.form-control:focus, .form-select:focus { border-color: var(--tp-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .22); }
.btn-outline-primary { --bs-btn-color: var(--tp-primary); --bs-btn-border-color: var(--tp-primary); --bs-btn-hover-bg: var(--tp-primary); --bs-btn-hover-border-color: var(--tp-primary); --bs-btn-active-bg: var(--tp-primary); }
.btn-icon { background: transparent; border: 0; color: inherit; padding: .4rem .55rem; border-radius: .5rem; }
.btn-icon:hover { background: var(--tp-primary-soft); }
.tp-skip { position: absolute; left: .5rem; top: .5rem; z-index: 2000; }

/* Barra superior y estructura */
.tp-topbar { position: sticky; top: 0; z-index: 1030; height: var(--tp-topbar-h); display: flex; align-items: center; gap: .5rem; padding: 0 .75rem; background: color-mix(in srgb, var(--tp-surface) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--tp-border); }
.tp-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: inherit; text-decoration: none; }
.tp-logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--tp-primary); color: #fff; }
.tp-logo-lg { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 16px; }
.tp-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--tp-primary-soft); color: var(--tp-primary); font-weight: 700; }
.tp-shell { display: flex; min-height: calc(100vh - var(--tp-topbar-h)); }
.tp-sidebar { width: var(--tp-sidebar-w); flex: 0 0 var(--tp-sidebar-w); background: var(--tp-surface); border-right: 1px solid var(--tp-border); }
@media (min-width: 992px) { .tp-sidebar { position: sticky; top: var(--tp-topbar-h); height: calc(100vh - var(--tp-topbar-h)); overflow-y: auto; } }
.tp-nav { list-style: none; margin: 0; padding: .6rem; display: flex; flex-direction: column; gap: 2px; }
.tp-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: .6rem; color: inherit; text-decoration: none; }
.tp-nav a:hover { background: var(--tp-primary-soft); }
.tp-nav a.active { background: var(--tp-primary-soft); color: var(--tp-primary); font-weight: 600; }
.tp-nav .bi { font-size: 1.1rem; }
.tp-main { flex: 1; min-width: 0; padding: 1.25rem; max-width: 1500px; }
@media (max-width: 575px) { .tp-main { padding: .85rem; } }
.tp-pill { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none; }
.tp-pill-ok { background: var(--tp-ok-soft); color: var(--tp-ok); }
.tp-pill-off { background: var(--tp-bad-soft); color: var(--tp-bad); }
.tp-pill-warn { background: var(--tp-warn-soft); color: var(--tp-warn); }
.tp-pending { background: var(--tp-accent); color: #000; border-radius: 999px; padding: 0 .4rem; margin-left: .3rem; font-size: .75rem; }

/* Tarjetas y tablas */
.tp-card { background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: 1.1rem; padding: 1.1rem 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.tp-card h2, .tp-card .h6 { font-size: .95rem; }
.tp-kpi { display: flex; flex-direction: column; gap: .15rem; }
.tp-kpi .v { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.tp-kpi .l { color: var(--tp-text-soft); font-size: .82rem; }
.tp-kpi .s { font-size: .78rem; color: var(--tp-text-soft); }
.tp-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.tp-page-head h1 { font-size: 1.35rem; margin: 0; }
.table > :not(caption) > * > * { padding: .55rem .65rem; }
.fixed-table-container { border-radius: .6rem; }
.bootstrap-table .fixed-table-toolbar { margin-bottom: .25rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-state { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.tp-state-ok { background: var(--tp-ok-soft); color: var(--tp-ok); }
.tp-state-warn { background: var(--tp-warn-soft); color: var(--tp-warn); }
.tp-state-bad { background: var(--tp-bad-soft); color: var(--tp-bad); }
.tp-state-off { background: color-mix(in srgb, var(--tp-text-soft) 14%, transparent); color: var(--tp-text-soft); }
.form-label { font-weight: 600; font-size: .86rem; }
.form-control, .form-select { border-radius: .55rem; }

/* Login */
.tp-guest { background: linear-gradient(160deg, var(--tp-primary-soft), var(--tp-bg)); min-height: 100vh; }
.tp-guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.tp-guest-card { width: 100%; max-width: 420px; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: 1.1rem; padding: 1.6rem; box-shadow: 0 10px 30px rgba(0,0,0,.06); }

/* Punto de venta */
.tp-pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1rem; height: calc(100vh - var(--tp-topbar-h) - 2.5rem); }
@media (max-width: 991px) { .tp-pos { grid-template-columns: 1fr; height: auto; } }
.tp-pos-left, .tp-pos-right { display: flex; flex-direction: column; min-height: 0; gap: .75rem; }
.tp-pos-search { position: relative; }
.tp-pos-search input { font-size: 1.15rem; padding: .8rem 1rem .8rem 2.8rem; border-radius: .8rem; }
.tp-pos-search .bi { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.1rem; color: var(--tp-text-soft); }
.tp-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; max-height: 52vh; overflow: auto; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: .8rem; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.tp-results button { width: 100%; text-align: left; border: 0; background: transparent; padding: .6rem .9rem; display: flex; justify-content: space-between; gap: 1rem; color: inherit; }
.tp-results button:hover, .tp-results button.active { background: var(--tp-primary-soft); }
.tp-favs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; overflow: auto; align-content: start; }
.tp-fav { border: 1px solid var(--tp-border); background: var(--tp-surface); border-radius: .8rem; padding: .6rem; text-align: left; min-height: 74px; display: flex; flex-direction: column; justify-content: space-between; color: inherit; }
.tp-fav:hover { border-color: var(--tp-primary); background: var(--tp-primary-soft); }
.tp-fav .n { font-weight: 600; font-size: .88rem; line-height: 1.15; }
.tp-fav .p { color: var(--tp-primary); font-weight: 700; }
.tp-cart { flex: 1; min-height: 160px; overflow: auto; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: .9rem; }
.tp-cart table { margin: 0; }
.tp-cart .qty { width: 78px; text-align: center; }
.tp-totals { background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: .9rem; padding: .9rem 1rem; }
.tp-total-big { font-size: 2.2rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.tp-pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.tp-keys kbd { font-size: .72rem; }
.tp-change { font-size: 1.6rem; font-weight: 700; color: var(--tp-primary); }
.tp-empty { text-align: center; color: var(--tp-text-soft); padding: 2.5rem 1rem; }

/* Recorridos guiados */
.tp-tour-overlay { position: fixed; inset: 0; z-index: 2100; background: rgba(0,0,0,.45); }
.tp-tour-spot { position: fixed; z-index: 2101; border-radius: .6rem; box-shadow: 0 0 0 9999px rgba(0,0,0,.5), 0 0 0 3px var(--tp-accent); pointer-events: none; transition: all .2s ease; }
.tp-tour-pop { position: fixed; z-index: 2102; width: min(340px, calc(100vw - 24px)); background: var(--tp-surface); color: inherit; border: 1px solid var(--tp-border); border-radius: .9rem; padding: 1rem; box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.tp-tour-pop h3 { font-size: 1rem; }
.tp-tour-dots { display: flex; gap: 4px; }
.tp-tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--tp-border); }
.tp-tour-dots i.on { background: var(--tp-primary); }

.no-screen { position: absolute; left: -10000px; top: 0; }
/* Impresión de comprobantes (58/80 mm) */
.ticket { width: 76mm; margin: 0 auto; font-family: "Courier New", monospace; font-size: 12px; color: #000; background: #fff; padding: 4mm; }
.ticket.w58 { width: 54mm; font-size: 11px; }
.ticket h1 { font-size: 15px; text-align: center; margin: 0; }
.ticket .c { text-align: center; }
.ticket hr { border: 0; border-top: 1px dashed #000; margin: 5px 0; }
.ticket table { width: 100%; border-collapse: collapse; }
.ticket td { padding: 1px 0; vertical-align: top; }
.ticket .r { text-align: right; }
@media print {
  body * { visibility: hidden; }
  .no-screen { position: static; left: 0; }
  .ticket, .ticket * { visibility: visible; }
  .ticket { position: absolute; left: 0; top: 0; }
  .no-print { display: none !important; }
  @page { margin: 0; }
}
