html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem rgb(255, 255, 255), 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.user-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 0.85rem;
  overflow: hidden; /* asegura que el footer y el hover respeten el borde redondeado */
}

/* Botonera inferior redondeada para coincidir con la tarjeta */
.user-card .card-footer .btn {
  border-radius: 0; /* base plana para que se vea como una barra */
}
.user-card .card-footer .btn:first-child {
  border-bottom-left-radius: 0.85rem;
}
.user-card .card-footer .btn:last-child {
  border-bottom-right-radius: 0.85rem;
}

/* Botonera inferior: botones de igual tamaño, sin separación, ocupan todo el ancho */
.user-card .card-footer .d-flex {
  display: flex;
  gap: 0; /* sin separación entre botones */
  width: 100%;
}
.user-card .card-footer .btn {
  flex: 1 1 0 !important; /* anula flex-fill (auto) de Bootstrap para igualar tamaños */
  min-width: 0; /* permite que el contenido se ajuste sin romper el layout */
  text-align: center;
}

/* Roles como tarjetas seleccionables */
.role-card {
  display: block;
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  padding: .75rem 1rem;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.role-card:hover {
  transform: translateY(-2px);
}
.role-check:focus + .role-card {
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.25);
}
.role-check:checked + .role-card {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
  background: rgba(13,110,253,.03);
}
.role-card .name { font-weight: 600; }
.role-card .desc { font-size: .875rem; }

/* Tabla de productos estilizada */
.table-products {
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 .35rem 1rem rgba(0,0,0,.08);
  width: 100%;
  table-layout: auto; /* evita recortes de contenido (botones) */
}
.table-products thead th {
  background: linear-gradient(135deg, #3484f3, #053b8d);
  color: #fff;
  border-color: rgba(255,255,255,.2) !important;
  font-weight: 600;
  letter-spacing: .2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.table-products thead th a {
  color: #fff !important; /* asegura encabezado y flecha en blanco */
}
.table-products thead th a:hover,
.table-products thead th a:focus {
  color: #fff !important;
  text-decoration: underline; /* indica interactividad, mantiene contraste */
}
.table-products tbody tr {
  transition: background-color .15s ease;
}
.table-products tbody tr:hover {
  background-color: rgba(13,110,253,.06);
}
.table-products tbody tr.clickable-row { cursor: pointer; }

/* Tablas de gestión de stock: bordes redondeados, tipografía del header y centrado de Cantidad */
.table-stock {
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 .35rem 1rem rgba(0,0,0,.08);
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  table-layout: auto;
}
.table-stock thead th {
  background: none !important;
  background-color: transparent !important;
  color: var(--bs-emphasis-color);
  border-color: var(--bs-border-color) !important;
  font-weight: 600;
  letter-spacing: .2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
}
.table-stock th,
.table-stock td { border-radius: 0 !important; }

/* Líneas divisorias verticales entre columnas (stock) */
.table-stock > :not(caption) > * > th:not(:last-child),
.table-stock > :not(caption) > * > td:not(:last-child) {
  border-right: 1px solid var(--bs-border-color);
}
.table-stock tbody tr { transition: background-color .15s ease; }
.table-stock tbody tr:hover { background-color: rgba(13,110,253,.06); }

/* Alineación específica para la columna Cantidad en tablas de stock
   (se maneja principalmente desde el marcado con .text-center en ese TD/TH). */
.table-stock th.text-center,
.table-stock td.text-center { text-align: center !important; }

/* Ajustes para tablas actuales en vista Stock/Index sin tocar el marcado */
.card .table { border-radius: .75rem; overflow: hidden; box-shadow: 0 .35rem 1rem rgba(0,0,0,.08); border-collapse: separate; border-spacing: 0; width:100%; table-layout: auto; }
.card .table thead th { background: none !important; background-color: transparent !important; color: var(--bs-emphasis-color); border-color: var(--bs-border-color) !important; font-weight:600; letter-spacing:.2px; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; text-align:center; }
.card .table th,
.card .table td { border-radius: 0 !important; }

/* Líneas divisorias verticales entre columnas en tablas dentro de cards (Stock/Index) */
.card .table > :not(caption) > * > th:not(:last-child),
.card .table > :not(caption) > * > td:not(:last-child) {
  border-right: 1px solid var(--bs-border-color);
}
.card .table tbody tr:hover { background-color: rgba(13,110,253,.06); }
.card .table td.text-success.fw-semibold,
.card .table td.text-danger.fw-semibold { text-align: center !important; }

/* Vista StockProducto/Manage: estilos y centrado de columna Cantidad */
.stock-manage .table { border-radius: .75rem; overflow: hidden; box-shadow: 0 .35rem 1rem rgba(0,0,0,.08); border-collapse: separate; border-spacing: 0; width:100%; table-layout: auto; }

/* Acción: asegura accesibilidad a botones de acciones */
/* Columna Acciones: header a la izquierda, celdas centradas y ancho ajustado al contenido */
.table-products thead th:last-child,
.table-products thead th.text-end:last-child { text-align: left !important; }
.table-products tbody td:last-child,
.table-products tbody td.text-end:last-child {
  text-align: center !important;
  white-space: nowrap;
  width: 1%; /* shrink-to-fit contenido (botones) */
}
.table-products tbody td:last-child .btn { margin: 0 .35rem .35rem .35rem; }
.stock-manage .table thead th { background: none !important; background-color: transparent !important; color: var(--bs-emphasis-color); border-color: var(--bs-border-color) !important; font-weight:600; letter-spacing:.2px; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; text-align:center; }
.stock-manage .table th,
.stock-manage .table td { border-radius: 0 !important; }

/* Evita duplicar borde si no se usa .table-bordered */
.stock-manage .table:not(.table-bordered) > :not(caption) > * > th:not(:last-child),
.stock-manage .table:not(.table-bordered) > :not(caption) > * > td:not(:last-child) {
  border-right: 1px solid var(--bs-border-color);
}
.stock-manage thead th:nth-child(2),
.stock-manage tbody td:nth-child(2) { text-align: center; }

/* Borde negro en letras de encabezados de tablas */
.table thead th,
.table-products thead th {
  /* Stroke para navegadores WebKit */
  -webkit-text-stroke: 0.1px #000;
  /* Sombra en 8 direcciones para simular borde en otros navegadores */
  text-shadow:
    -0.6px -0.2px 0 #000,
    0    -0.2px 0 #000,
    0.2px -0.2px 0 #000,
    0.2px  0     0 #000,
    0.2px  0.2px 0 #000,
   -0.2px  0.2px 0 #000,
   -0.2px  0     0 #000,
    0      0.2px 0 #000;
}

.user-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12), 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

.user-card:active {
  transform: translateY(-2px) scale(0.997);
}

/* Botón destacado con sombra y transición */
.btn-cta {
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  border-radius: .6rem;
}
.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.2);
  filter: brightness(1.03);
}
.btn-cta:active {
  transform: translateY(-1px);
  box-shadow: 0 .35rem .85rem rgba(0,0,0,.18);
  filter: brightness(0.98);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ========== Categorías (selección visual) ========== */
.cat-box {
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  padding: .6rem .75rem;
  background: #fff;
  min-height: 52px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .95rem; /* un poco más grande */
  padding: .35rem .6rem;
  border-radius: 999px;
}
.cat-chip .btn-close {
  width: .7rem;
  height: .7rem;
  opacity: .9;
  color: var(--bs-primary); /* icono más visible (usa currentColor) */
}
.cat-chip .btn-close:hover { opacity: 1; }

/* ===== Header / Navbar overrides (global, no scoped CSS) ===== */
.app-navbar {
  background: linear-gradient(135deg, #3484f3, #053b8d);
}
.app-navbar .navbar-brand {
  color: #fff;
}
.app-navbar .text-dark {
  color: #f1f5ff !important; /* neutraliza .text-dark de Bootstrap en el header */
}
.app-navbar .nav-link {
  color: #f1f5ff !important; /* texto claro y legible */
  background-color: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.22);
  padding: .425rem .9rem;
  margin-right: .35rem;
  border-radius: .6rem;
  font-weight: 500;
  letter-spacing: .2px;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease, transform .12s ease, filter .15s ease;
}
.app-navbar .nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(0,0,0,.22);
  border-color: rgba(255,255,255,.34);
  transform: translateY(-1px);
}
.app-navbar .nav-link:active {
  transform: translateY(0);
  background-color: rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.42);
}
.app-navbar .nav-link.active {
  color: #ffffff !important;
  background-color: rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.45);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
}
.app-navbar .nav-link:focus-visible {
  outline: 3px solid rgba(255,255,255,.5);
  outline-offset: 2px;
}

/* Barra de búsqueda en Stock: anclada bajo el header */
.stock-search-bar {
  background: #fff;
  border-bottom: 1px solid var(--bs-border-color);
  padding: .5rem .25rem;
  z-index: 1010;
}

.badge {
  font-weight: 600;
  font-size: .875rem;
  border-radius: .6rem;
  padding: .4rem .75rem;
}

/* Botón "Ver historial de ventas" en pantalla de ventas */
.btn-historial-ventas:hover {
  background-color: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}
