/* ==========================================================================
   Greta Store - estilos de la aplicación (sobre Bootstrap 5.3)
   ========================================================================== */
:root {
  --app-bg: #f4f6fb;
  --app-text: #1f2937;
  --app-muted: #6b7280;
  --app-border: #e5e7eb;
  --app-accent: #6366f1;
  --app-accent-dark: #4f46e5;
  --app-accent-soft: #eef2ff;
  --app-radius: .8rem;
  --sidebar-w: 252px;

  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-bg: var(--app-bg);
  --bs-body-color: var(--app-text);
  --bs-primary: #6366f1;
  --bs-primary-rgb: 99, 102, 241;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: #4338ca;
  --bs-link-hover-color-rgb: 67, 56, 202;
  --bs-border-radius: .55rem;
}

body { background: var(--app-bg); -webkit-font-smoothing: antialiased; }

/* ---- Controles con el color de acento -------------------------------- */
.btn { font-weight: 500; }
.btn-primary {
  --bs-btn-bg: var(--app-accent); --bs-btn-border-color: var(--app-accent);
  --bs-btn-hover-bg: var(--app-accent-dark); --bs-btn-hover-border-color: var(--app-accent-dark);
  --bs-btn-active-bg: #4338ca; --bs-btn-active-border-color: #4338ca;
  --bs-btn-disabled-bg: var(--app-accent); --bs-btn-disabled-border-color: var(--app-accent);
  box-shadow: 0 1px 2px rgba(79, 70, 229, .25);
}
.btn-outline-primary {
  --bs-btn-color: var(--app-accent-dark); --bs-btn-border-color: #c7d2fe;
  --bs-btn-hover-bg: var(--app-accent); --bs-btn-hover-border-color: var(--app-accent); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--app-accent-dark); --bs-btn-active-border-color: var(--app-accent-dark);
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--app-border); --bs-btn-hover-bg: #f9fafb; --bs-btn-hover-border-color: #d1d5db; }
.btn-icon { display: inline-flex; align-items: center; gap: .4rem; }
.btn-square { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }

.form-label { font-weight: 500; font-size: .875rem; color: #374151; margin-bottom: .35rem; }
.form-control, .form-select { border-color: #d9dde5; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .16); }
.form-control[readonly] { background: #f9fafb; color: var(--app-muted); }
.form-check-input:checked { background-color: var(--app-accent); border-color: var(--app-accent); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .16); border-color: #a5b4fc; }
.input-group-text { background: #fff; border-color: #d9dde5; color: var(--app-muted); }
.req::after { content: " *"; color: #e11d48; }

.pagination {
  --bs-pagination-color: var(--app-accent-dark); --bs-pagination-hover-color: var(--app-accent-dark);
  --bs-pagination-active-bg: var(--app-accent); --bs-pagination-active-border-color: var(--app-accent);
  --bs-pagination-border-color: var(--app-border); --bs-pagination-focus-box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .16);
  gap: .25rem;
}
.pagination .page-link { border-radius: .45rem !important; min-width: 34px; text-align: center; }

/* ---- Estructura: barra lateral + contenido --------------------------- */
.sidebar {
  background: linear-gradient(180deg, #111827 0%, #1e1b4b 100%);
  color: #cbd5e1;
  display: flex; flex-direction: column;
  --bs-offcanvas-width: var(--sidebar-w);
}
.sidebar .offcanvas-body { display: flex; flex-direction: column; flex-grow: 1; overflow-y: auto; padding: 0; }
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1030; }
  .app-main { margin-left: var(--sidebar-w); }
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.35rem 1.25rem 1rem; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em;
}
.sidebar-brand:hover { color: #fff; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-size: 1.15rem;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  box-shadow: 0 6px 18px rgba(99, 102, 241, .45);
}
.brand-sub { display: block; font-size: .72rem; font-weight: 500; color: #94a3b8; letter-spacing: 0; }
.sidebar-section {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: #64748b; padding: 1.1rem 1.5rem .4rem; font-weight: 600;
}
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  margin: .1rem .75rem; padding: .55rem .8rem; border-radius: .55rem;
  color: #cbd5e1; text-decoration: none; font-size: .92rem;
  transition: background-color .15s, color .15s;
}
.sidebar-link i { font-size: 1.05rem; width: 1.15rem; text-align: center; opacity: .9; }
.sidebar-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-link.active { background: rgba(129, 140, 248, .2); color: #fff; box-shadow: inset 3px 0 0 #818cf8; }
.sidebar-link.disabled { opacity: .45; cursor: default; }
.sidebar-link.disabled:hover { background: transparent; color: #cbd5e1; }
.pill-soon {
  margin-left: auto; font-size: .62rem; font-weight: 600; letter-spacing: .03em;
  padding: .15rem .5rem; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #94a3b8;
}
.sidebar-footer { margin-top: auto; padding: 1rem 1.25rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-footer small { color: #64748b; }

.topbar {
  position: sticky; top: 0; z-index: 1020; height: 64px;
  display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--app-border);
}
.topbar-title { font-weight: 600; font-size: 1rem; margin: 0; }
.user-chip {
  display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem .3rem .3rem;
  border-radius: 999px; border: 1px solid transparent; background: transparent; color: inherit;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: #f3f4f6; border-color: var(--app-border); }
.user-chip .lh-sm small { color: var(--app-muted); }
.content { padding: 1.75rem 1.5rem 3rem; max-width: 1440px; }
@media (max-width: 575.98px) { .content { padding: 1.25rem 1rem 2.5rem; } .topbar { padding: 0 1rem; } }

/* ---- Componentes ------------------------------------------------------ */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center;
  font-weight: 600; font-size: .8rem; letter-spacing: .02em;
  background: var(--app-accent-soft); color: var(--app-accent-dark);
}
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar-1 { background: #eef2ff; color: #4f46e5; }
.avatar-2 { background: #ecfdf5; color: #059669; }
.avatar-3 { background: #fff7ed; color: #ea580c; }
.avatar-4 { background: #fdf2f8; color: #db2777; }
.avatar-5 { background: #f0f9ff; color: #0284c7; }

.card {
  border: 1px solid var(--app-border); border-radius: var(--app-radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --bs-card-inner-border-radius: calc(var(--app-radius) - 1px);
}
.card > .card-header { background: #fff; border-bottom: 1px solid var(--app-border); padding: 1rem 1.25rem; }
.card-title-sm { font-size: .98rem; font-weight: 600; margin: 0; }
.card-subtitle-sm { font-size: .82rem; color: var(--app-muted); margin: .15rem 0 0; }

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-header p { color: var(--app-muted); margin: .25rem 0 0; font-size: .92rem; }

.toolbar { padding: .9rem 1.25rem; border-bottom: 1px solid var(--app-border); }

.table-app { --bs-table-hover-bg: #f8f9ff; margin-bottom: 0; }
.table-app thead th {
  background: #f9fafb; color: var(--app-muted);
  font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--app-border); white-space: nowrap;
}
.table-app td { padding: .8rem 1.25rem; border-color: #f1f2f6; vertical-align: middle; }
.table-app tbody tr:last-child td { border-bottom: 0; }
.cell-title { font-weight: 600; color: var(--app-text); }
.cell-sub { font-size: .8rem; color: var(--app-muted); }

.badge-soft { background: var(--app-accent-soft); color: var(--app-accent-dark); font-weight: 600; }
.badge-soft-success { background: #ecfdf5; color: #047857; font-weight: 600; }
.badge-soft-muted { background: #f3f4f6; color: #4b5563; font-weight: 600; }
.badge-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .4rem; vertical-align: middle; }

.empty-state { padding: 3.25rem 1rem; text-align: center; color: var(--app-muted); }
.empty-state i { font-size: 2.4rem; display: block; margin-bottom: .6rem; color: #c7d2fe; }
.empty-state strong { display: block; color: var(--app-text); margin-bottom: .2rem; }

.alert { border: 0; border-radius: .7rem; display: flex; gap: .65rem; align-items: flex-start; }
.alert > i { font-size: 1.1rem; line-height: 1.3; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-info { background: #eff6ff; color: #1e40af; }
.alert ul { margin: 0; padding-left: 1.1rem; }

/* Tarjetas de indicadores y accesos */
.stat-card { height: 100%; }
.stat-card .card-body { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.stat-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.stat-label { color: var(--app-muted); font-size: .84rem; }
.tint-indigo { background: #eef2ff; color: #4f46e5; }
.tint-emerald { background: #ecfdf5; color: #059669; }
.tint-amber { background: #fffbeb; color: #d97706; }
.tint-rose { background: #fff1f2; color: #e11d48; }
.tint-sky { background: #f0f9ff; color: #0284c7; }
.tint-violet { background: #f5f3ff; color: #7c3aed; }

.module-tile { height: 100%; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.module-tile .card-body { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.25rem; }
.module-tile:hover { transform: translateY(-2px); border-color: #c7d2fe; box-shadow: 0 10px 24px rgba(16, 24, 40, .08); }
.module-tile.is-soon { opacity: .62; }
.module-tile.is-soon:hover { transform: none; box-shadow: none; border-color: var(--app-border); }
.module-tile .module-name { font-weight: 600; }
.module-tile .module-hint { font-size: .8rem; color: var(--app-muted); }
.module-tile .badge { font-size: .65rem; }
.min-w-0 { min-width: 0; }

/* ---- Productos e inventario ------------------------------------------- */
.thumb { width: 46px; height: 46px; border-radius: .6rem; object-fit: cover; flex-shrink: 0; background: #f3f4f6; border: 1px solid var(--app-border); }
.thumb-sm { width: 36px; height: 36px; border-radius: .5rem; object-fit: cover; flex-shrink: 0; background: #f3f4f6; border: 1px solid var(--app-border); }
.thumb-vacia { display: inline-grid; place-items: center; color: #c0c6d4; font-size: 1.15rem; }
.thumb-sm.thumb-vacia { font-size: .95rem; }
.talla-chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600;
  padding: .15rem .5rem; border-radius: 999px; background: #f3f4f6; color: #374151; margin: .1rem .15rem .1rem 0;
}
.talla-chip b { font-weight: 700; color: var(--app-accent-dark); }
.talla-chip.agotada { background: #fef2f2; color: #b91c1c; }
.talla-chip.agotada b { color: #b91c1c; }
.qty { display: inline-block; min-width: 2.4rem; text-align: center; font-weight: 700; padding: .15rem .5rem; border-radius: .45rem; background: #ecfdf5; color: #047857; }
.qty.baja { background: #fffbeb; color: #b45309; }
.qty.cero { background: #fef2f2; color: #b91c1c; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.galeria-item { position: relative; border: 1px solid var(--app-border); border-radius: .7rem; overflow: hidden; background: #fff; }
.galeria-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.galeria-item .acciones { display: flex; gap: .25rem; padding: .4rem; justify-content: space-between; border-top: 1px solid var(--app-border); }
.galeria-item .badge-principal { position: absolute; top: .4rem; left: .4rem; }
.dropzone {
  border: 2px dashed #c7d2fe; border-radius: .8rem; background: #fafbff; padding: 1.25rem; text-align: center;
  color: var(--app-muted); cursor: pointer; transition: background-color .15s, border-color .15s;
}
.dropzone:hover, .dropzone.activa { background: var(--app-accent-soft); border-color: var(--app-accent); }
.dropzone i { font-size: 1.8rem; color: var(--app-accent); display: block; margin-bottom: .25rem; }
.preview-fotos { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.preview-fotos img { width: 72px; height: 72px; object-fit: cover; border-radius: .5rem; border: 1px solid var(--app-border); }

.sugerencias { position: absolute; z-index: 1050; left: 0; right: 0; top: 100%; margin-top: .25rem; max-height: 340px; overflow-y: auto; }
.sugerencias .list-group-item { display: flex; gap: .75rem; align-items: center; cursor: pointer; }
.sugerencias .list-group-item.active, .sugerencias .list-group-item:hover { background: var(--app-accent-soft); color: inherit; border-color: var(--app-border); }
.producto-elegido { border: 1px solid #c7d2fe; background: #fafbff; border-radius: .8rem; padding: 1rem; }
.tabla-lineas td { vertical-align: top; }
.tabla-lineas .form-control { min-width: 90px; }
.tabla-lineas .col-talla .form-control { min-width: 120px; }

/* ---- Facturación ------------------------------------------------------- */
.table-app tr.table-danger > td { background: #fef2f2; }
.table-app .cant { min-width: 56px; }
.table-app .cant::-webkit-inner-spin-button { opacity: .4; }

/* ---- Impresión: solo el documento -------------------------------------- */
@media print {
  .sidebar, .topbar, .no-print, .alert { display: none !important; }
  .app-main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  body { background: #fff; }
  .factura-doc { border: 0; box-shadow: none; }
  .page-header { margin-bottom: .5rem; }
}

/* ---- Celular: tablas compactas y encabezados apilados ----------------- */
@media (max-width: 767.98px) {
  .page-header { align-items: stretch !important; }
  .page-header > div:last-child { width: 100%; }
  .page-header > div:last-child .btn { flex: 1; justify-content: center; }
  .table-app td, .table-app thead th { padding-left: .9rem; padding-right: .9rem; }
  .table-app .btn-label { display: none; }
  .toolbar .input-group { max-width: none !important; flex: 1 1 100%; }
}

.welcome {
  border: 0; color: #fff; overflow: hidden; position: relative;
  background: radial-gradient(700px 300px at 100% 0%, rgba(165, 180, 252, .45), transparent 60%),
              linear-gradient(120deg, #312e81 0%, #4f46e5 60%, #6366f1 100%);
}
.welcome .card-body { padding: 1.6rem 1.75rem; }
.welcome h2 { font-size: 1.35rem; font-weight: 700; margin: 0 0 .25rem; }
.welcome p { margin: 0; color: rgba(255, 255, 255, .8); }
.welcome .bi-stars { position: absolute; right: 1.5rem; bottom: -1rem; font-size: 6.5rem; opacity: .12; }

/* Formularios por secciones */
.form-section + .form-section { border-top: 1px solid var(--app-border); }
.form-section { padding: 1.5rem 1.25rem; }
.form-section-head { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1.1rem; }
.form-section-head .stat-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 1.05rem; }
.form-section-head h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.form-section-head p { font-size: .84rem; color: var(--app-muted); margin: .1rem 0 0; }
.form-actions { padding: 1rem 1.25rem; border-top: 1px solid var(--app-border); background: #fafbfc; border-radius: 0 0 var(--app-radius) var(--app-radius); }
.switch-card { border: 1px solid var(--app-border); border-radius: .65rem; padding: .9rem 1rem; background: #fafbff; }

/* ---- Inicio de sesión ------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth { grid-template-columns: 1.05fr 1fr; } }
.auth-hero {
  display: none; position: relative; overflow: hidden; color: #fff; padding: 3rem 3.5rem;
  background: radial-gradient(900px 500px at -10% -10%, rgba(129, 140, 248, .55), transparent 60%),
              radial-gradient(700px 400px at 110% 110%, rgba(236, 72, 153, .25), transparent 60%),
              linear-gradient(135deg, #111827 0%, #1e1b4b 50%, #312e81 100%);
}
@media (min-width: 992px) { .auth-hero { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-hero h1 { font-size: 2.2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 1rem; }
.auth-hero p { color: rgba(255, 255, 255, .72); font-size: 1.02rem; max-width: 30rem; }
.auth-feature { display: flex; gap: .75rem; align-items: center; color: rgba(255, 255, 255, .85); margin-top: .9rem; }
.auth-feature i { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--app-bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .card-body { padding: 2.25rem; }
.auth-card h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .25rem; }
.auth-card .form-control { padding: .65rem .85rem; }
.auth-card .input-group-text { padding: 0 .85rem; }
.auth-card .btn-primary { padding: .65rem; }

/* ---- Cambios de prendas y edición de facturas ---------------------------------- */
.diferencia-box { border: 1px solid var(--app-border); background: #f8fafc; transition: background .15s, border-color .15s; }
.diferencia-box.dif-cobro { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.diferencia-box.dif-devolucion { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.diferencia-box.dif-cero { color: var(--app-muted); }
.linea-quitada td { text-decoration: line-through; color: var(--app-muted); }
.linea-quitada td:last-child, .linea-quitada td:nth-child(4) { text-decoration: none; }
.historial-item { border-left: 3px solid var(--app-accent-soft); padding: .15rem 0 .15rem .9rem; }
.historial-item + .historial-item { margin-top: 1rem; }
.historial-item.eliminar { border-left-color: #fecaca; }
.historial-item ul { margin: .35rem 0 0; padding-left: 1.1rem; }

/* ---- Reportes y gráficas ---------------------------------------------------------- */
.reportes-tabs { display: flex; flex-wrap: wrap; gap: .25rem; padding: .75rem .75rem 0; border-bottom: 1px solid var(--app-border); }
.reportes-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .85rem; border-radius: .6rem .6rem 0 0; font-size: .875rem;
  color: var(--app-muted); text-decoration: none; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.reportes-tab:hover { color: var(--app-text); background: #f8fafc; }
.reportes-tab.activo { color: var(--app-accent); background: #fff; border-color: var(--app-border); font-weight: 600; }
.table-sm-text { font-size: .85rem; }
.table-sm-text tfoot td { background: #eef2ff; border-top: 2px solid var(--app-accent-soft); }
.grafica { min-height: 120px; }
.grafica-svg { width: 100%; height: auto; display: block; }
.g-rejilla { stroke: #eef0f4; stroke-width: 1; }
.g-base { stroke: #cbd5e1; stroke-width: 1; }
.g-eje { font-size: 11px; fill: #64748b; }
.grafica-svg rect:hover { opacity: .8; }
.g-leyenda { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; font-size: .8rem; color: var(--app-muted); margin-top: .5rem; }
.g-leyenda i, .g-leyenda-dona i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.g-barras { display: flex; flex-direction: column; gap: .55rem; }
.g-fila { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: .75rem; font-size: .84rem; }
.g-etiqueta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-pista { background: #f1f5f9; border-radius: 999px; height: .7rem; overflow: hidden; }
.g-relleno { height: 100%; border-radius: 999px; }
.g-valor { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 5.5rem; }
.g-dona { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.25rem; }
.g-dona svg { width: 190px; max-width: 100%; flex-shrink: 0; }
.g-dona circle:hover { stroke-width: 34; }
.g-centro-l { font-size: 12px; fill: #64748b; }
.g-centro { font-size: 17px; font-weight: 700; fill: #1e293b; }
.g-leyenda-dona { list-style: none; padding: 0; margin: 0; font-size: .84rem; flex: 1 1 200px; }
.g-leyenda-dona li { display: flex; align-items: center; gap: .25rem; padding: .3rem 0; border-bottom: 1px dashed #eef0f4; }
.g-l-nombre { flex: 1; }
.g-l-valor { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.g-l-valor small { color: var(--app-muted); font-weight: 400; }
.g-vacia { color: var(--app-muted); text-align: center; padding: 2.5rem 0; font-size: .9rem; }
@media print { .grafica-svg, .g-dona svg { break-inside: avoid; } .reportes-tabs { display: none; } }

/* ---- Navegación sin recargar (app.js): barra de carga y avisos flotantes ------------------ */
.barra-carga { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899); box-shadow: 0 0 8px rgba(99, 102, 241, .6); transition: width .2s, opacity .3s; }
.barra-carga.activa { opacity: 1; width: 85%; transition: width 8s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
body.ajax-cargando .content { opacity: .55; pointer-events: none; transition: opacity .15s .12s; }
body.ajax-cargando { cursor: progress; }
.toast-zona { position: fixed; top: 1rem; right: 1rem; z-index: 2100; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast-app { display: flex; align-items: flex-start; gap: .65rem; padding: .8rem .9rem; border-radius: .75rem; background: #fff; font-size: .9rem;
  border: 1px solid var(--app-border); box-shadow: 0 10px 30px rgba(15, 23, 42, .15); transform: translateX(20px); opacity: 0; transition: transform .25s, opacity .25s; }
.toast-app.visible { transform: none; opacity: 1; }
.toast-app > div { flex: 1; }
.toast-app > i { font-size: 1.1rem; margin-top: 1px; }
.toast-success { border-left: 4px solid #10b981; } .toast-success > i { color: #10b981; }
.toast-danger { border-left: 4px solid #ef4444; } .toast-danger > i { color: #ef4444; }
.toast-warning { border-left: 4px solid #f59e0b; } .toast-warning > i { color: #f59e0b; }
.toast-info { border-left: 4px solid #6366f1; } .toast-info > i { color: #6366f1; }
@media print { .toast-zona, .barra-carga { display: none !important; } }

/* ---- Barrio con buscador, productos inactivos y últimas compras ---------------------------- */
#sugBarrios { max-height: 280px; overflow-y: auto; }
.list-group-item-otro { color: var(--app-accent); font-weight: 500; border-top: 1px dashed var(--app-border); }
.list-group-item-otro.active { color: #fff; }
.fila-inactiva td { opacity: .6; }
.fila-inactiva td:last-child { opacity: 1; }
.ultimas-compras { margin-top: .75rem; border: 1px solid var(--app-border); border-radius: .65rem; padding: .6rem .75rem; background: #fafbff; max-width: 560px; }
.ultimas-compras table { font-size: .84rem; --bs-table-bg: transparent; }
.ultimas-compras th { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--app-muted); font-weight: 600; border-bottom-width: 1px; }
.ultimas-compras td { vertical-align: middle; }


/* ---- Ajustes: pestañas, logo y medidas del ticket ------------------------------------------ */
.ajustes-tabs { gap: .35rem; flex-wrap: wrap; }
.ajustes-tabs .nav-link { display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px; padding: .45rem .95rem; font-weight: 600; font-size: .9rem; color: #4b5563; background: #fff; border: 1px solid var(--app-border); }
.ajustes-tabs .nav-link:hover { color: #111827; border-color: #d1d5db; }
.ajustes-tabs .nav-link.active { color: #fff; background: var(--app-accent); border-color: var(--app-accent); }
.ajustes-paneles .card { max-width: 920px; }
.logo-vista { width: 180px; height: 110px; display: flex; align-items: center; justify-content: center; padding: .6rem; text-align: center;
  border: 1px dashed #d1d5db; border-radius: .75rem; background: repeating-conic-gradient(#f3f4f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.logo-vista img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ticket-medida { font-size: .85rem; padding: .55rem .75rem; border-radius: .6rem; background: #eef2ff; color: #3730a3; min-height: 38px; }
