/* src/css/pages/caja.css */

.caja-layout {
  display: flex;
  min-height: 100vh;
  background-color: #f9fafb !important;
  color: #111827 !important;
}

/* Sidebar */
.caja-sidebar {
  width: 260px;
  background-color: #ffffff !important;
  border-right: 1px solid #e5e7eb !important;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03) !important;
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem;
  flex-shrink: 0;
}

.caja-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: #E4002B !important;
  font-weight: bold;
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed #e5e7eb !important;
}

#cajaUserInfo,
.caja-user-info {
  font-size: 0.85rem;
  color: #4b5563 !important;
  text-align: center;
  margin-bottom: 1.5rem;
  background: #f9fafb !important;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb !important;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
}

.sidebar-item-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent !important;
  color: #4b5563 !important;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  outline: none !important;
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.sidebar-item-btn:focus,
.sidebar-item-btn:active,
.sidebar-item-btn:focus-visible {
  outline: none !important;
  outline: 0 !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

.sidebar-item-btn:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

.sidebar-item-btn.active {
  background: #FEE2E2 !important; /* Soft red tint */
  border: 1px solid #E4002B !important;
  color: #E4002B !important;
}

.sidebar-item-btn.active:focus,
.sidebar-item-btn.active:active,
.sidebar-item-btn.active:focus-visible {
  border-color: #E4002B !important;
  outline: none !important;
  box-shadow: none !important;
}

.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: auto;
}

.badge-danger {
  background-color: #ef4444;
  color: white;
}

.badge-warning {
  background-color: #f59e0b;
  color: black;
}

.badge-info {
  background-color: #3b82f6;
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px dashed #e5e7eb !important;
}

.sidebar-footer .btn-secondary {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border: 1px solid #e5e7eb !important;
}

.sidebar-footer .btn-secondary:hover {
  background: #e5e7eb !important;
  color: #111827 !important;
}

/* Main Workspace */
.caja-main {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
  height: 100vh;
  background-color: #f9fafb !important;
  color: #111827 !important;
}

.caja-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  border-bottom: none;
  padding-bottom: 1.5rem;
}

.caja-title-box h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: #111827 !important;
  margin-bottom: 0.3rem;
}

.caja-title-box p {
  color: #4b5563 !important;
  font-size: 0.95rem;
}

/* Tab content controls */
.caja-tab-content {
  display: none;
}

.caja-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards grids */
.caja-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.caja-mesas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.2rem;
}

/* Order cards in Caja (.pedido-card, .mesa-card, .caja-order-card, .domi-card) */
.caja-order-card,
.caja-mesa-card,
.domi-card,
.pedido-card,
.mesa-card {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  color: #111827 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
  border-radius: 14px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.caja-order-card:hover,
.pedido-card:hover,
.domi-card:hover {
  border-color: #d1d5db !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-2px);
}

/* Order card header, client name, items list, prices */
.caja-order-header,
.pedido-card-header,
.mesa-card-header,
.domi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-bottom: 1px dashed #e5e7eb !important;
  padding-bottom: 0.5rem;
  color: #111827 !important;
}

.caja-order-title,
.pedido-card-title,
.caja-order-cliente,
.pedido-cliente,
.domi-card-title,
.domi-card-body,
.client-name {
  font-size: 0.95rem;
  font-weight: bold;
  color: #111827 !important;
}

.caja-order-type {
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
}

.type-mesa {
  background: #fee2e2;
  color: #E4002B;
  border: 1px solid #fca5a5;
}

.type-domicilio {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #7dd3fc;
}

.type-llevar {
  background: #f3e8ff;
  color: #9333ea;
  border: 1px solid #d8b4fe;
}

.caja-order-body {
  flex: 1;
}

.caja-order-details {
  font-size: 0.75rem;
  color: #4b5563 !important;
  background: #f9fafb !important;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb !important;
  margin-bottom: 0.6rem;
}

.caja-order-items,
.caja-order-items-cocina,
.pedido-items,
.items-list,
.cuenta-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #111827 !important;
}

.caja-order-item,
.caja-order-item-cocina {
  font-size: 0.82rem;
  color: #111827 !important;
}

.caja-item-qty,
.caja-item-qty-cocina {
  font-weight: bold;
  color: #E4002B !important;
  margin-right: 0.3rem;
}

.caja-item-notes,
.caja-item-notes-cocina {
  display: block;
  font-size: 0.75rem;
  color: #b45309 !important;
  margin-left: 1rem;
}

.caja-order-footer {
  border-top: 1px dashed #e5e7eb !important;
  padding-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: auto;
}

.caja-order-total-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.caja-order-total-label {
  font-size: 0.8rem;
  color: #4b5563 !important;
  font-weight: 500;
}

.caja-order-total,
.pedido-total,
.order-price,
.item-price,
.cuenta-item-sub {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827 !important;
}

.caja-order-actions {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.caja-order-footer button,
.caja-order-footer .btn-approve,
.caja-order-footer .btn-reject,
.caja-order-footer .btn-dispatch-delivery,
.caja-order-footer .btn-secondary,
.caja-order-footer .btn-primary {
  flex: 1;
  width: 100%;
  padding: 0.45rem 0.8rem !important;
  font-size: 0.82rem !important;
  font-weight: bold;
  height: 36px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-approve {
  background: #dcfce7 !important;
  color: #16a34a !important;
  border: 1px solid #86efac !important;
}

.btn-approve:hover {
  background: #bbf7d0 !important;
  border-color: #4ade80 !important;
  transform: translateY(-1px);
}

.btn-reject {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
}

.btn-reject:hover {
  background: #fecaca !important;
  border-color: #f87171 !important;
  transform: translateY(-1px);
}

.btn-dispatch-delivery {
  background: #fee2e2 !important;
  color: #E4002B !important;
  border: 1px solid #fca5a5 !important;
}

.btn-dispatch-delivery:hover {
  background: #fecaca !important;
  border-color: #E4002B !important;
  transform: translateY(-1px);
}

/* Mesas Layout in Caja */
.caja-mesa-card,
.mesa-card {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px;
  padding: 0.95rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
  color: #111827 !important;
}

.caja-mesa-card.libre {
  border-top: 4px solid #16a34a !important;
}

.caja-mesa-card.libre:hover {
  transform: translateY(-3px);
  border-color: #16a34a !important;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.15) !important;
}

.caja-mesa-card.ocupada {
  border-top: 4px solid #E4002B !important;
}

.caja-mesa-card.ocupada:hover {
  transform: translateY(-3px);
  border-color: #E4002B !important;
  box-shadow: 0 8px 20px rgba(228, 0, 43, 0.15) !important;
}

.caja-mesa-number {
  font-size: 1.15rem;
  font-weight: bold;
  color: #111827 !important;
  margin-bottom: 0.1rem;
  transition: transform 0.3s ease;
}

.caja-mesa-nombre-custom {
  font-size: 0.85rem;
  font-weight: normal;
  color: #4b5563 !important;
  margin-bottom: 0.2rem;
}

.caja-mesa-card:hover .caja-mesa-number {
  transform: scale(1.05);
}

.caja-mesa-status {
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280 !important;
}

.caja-mesa-total {
  margin-top: 0.8rem;
  font-size: 1.15rem;
  font-weight: bold;
  color: #E4002B !important;
}

/* Animations */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Optimización para Dispositivos Móviles (Responsive) */
@media (max-width: 900px) {
  .caja-layout {
    flex-direction: column;
    min-height: auto;
  }

  .caja-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 1.2rem 1rem;
    gap: 1rem;
    background-color: #ffffff !important;
  }

  .caja-logo {
    margin-bottom: 0.5rem;
    border-bottom: none !important;
    padding-bottom: 0;
  }

  .caja-user-info {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    padding: 0.4rem;
  }

  .sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .sidebar-menu::-webkit-scrollbar {
    height: 3px;
  }

  .sidebar-menu::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 99px;
  }

  .sidebar-item-btn {
    white-space: nowrap;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    justify-content: center;
  }

  .sidebar-footer {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #e5e7eb !important;
    margin-top: 0.5rem;
    width: 100%;
  }

  .sidebar-footer a,
  .sidebar-footer button {
    flex: 1;
    margin-bottom: 0 !important;
    padding: 0.6rem 0.5rem !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    text-align: center;
  }

  .caja-main {
    padding: 1.5rem 1rem;
    height: auto;
    overflow-y: visible;
  }

  .caja-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }

  .caja-title-box h1 {
    font-size: 1.6rem;
  }

  .caja-title-box p {
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) {
  .caja-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .caja-mesas-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
  }
}

/* Botones de Acciones del Historial (Caja) */
.caja-acciones-cell {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Botones con texto */
.btn-ver-comanda {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: bold;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  color: #2563eb !important;
  cursor: pointer;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-ver-comanda:hover {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  transform: translateY(-1px);
}

.btn-ver-comanda:active {
  transform: scale(0.95);
}

.btn-whatsapp-caja {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: bold;
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  color: #059669 !important;
  cursor: pointer;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-whatsapp-caja:hover:not(.disabled) {
  background: #d1fae5 !important;
  border-color: #6ee7b7 !important;
  color: #047857 !important;
  transform: translateY(-1px);
}

.btn-whatsapp-caja:active:not(.disabled) {
  transform: scale(0.95);
}

.btn-whatsapp-caja.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f3f4f6 !important;
  border: 1px dashed #d1d5db !important;
  color: #9ca3af !important;
}

/* Versión de icono compacto para la tabla */
.btn-ver-comanda-icon,
.btn-whatsapp-caja-icon {
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
  padding: 0;
}

.btn-ver-comanda-icon {
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  color: #2563eb !important;
}

.btn-ver-comanda-icon:hover {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  transform: scale(1.05);
}

.btn-ver-comanda-icon:active {
  transform: scale(0.95);
}

.btn-whatsapp-caja-icon {
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  color: #059669 !important;
}

.btn-whatsapp-caja-icon:hover:not(.disabled) {
  background: #d1fae5 !important;
  border-color: #6ee7b7 !important;
  color: #047857 !important;
  transform: scale(1.05);
}

.btn-whatsapp-caja-icon:active:not(.disabled) {
  transform: scale(0.95);
}

.btn-whatsapp-caja-icon.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f3f4f6 !important;
  border: 1px dashed #d1d5db !important;
  color: #9ca3af !important;
}

/* Modales in caja */
.modal-caja-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-caja-overlay.open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.caja-modal-card {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 20px;
  width: 95%;
  max-width: 500px;
  max-height: 95vh;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .caja-modal-card {
    max-width: 820px;
  }
}

/* Modal double column layout for account details */
.modal-body-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
}

@media (min-width: 640px) {
  .modal-body-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 1.5rem;
  }
}

.modal-col-left {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

@media (min-width: 640px) {
  .modal-col-left {
    border-right: 1px dashed #e5e7eb !important;
    padding-right: 1.2rem;
  }
}

.modal-col-right {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cuenta-items-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 0.5rem;
}

@media (min-width: 640px) {
  .cuenta-items-list {
    max-height: 380px !important;
  }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #e5e7eb !important;
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  width: 100%;
}

.modal-header-actions h3 {
  font-size: 1.35rem;
  font-weight: bold;
  color: #E4002B !important;
  margin: 0;
}

.cuenta-item-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #e5e7eb !important;
  color: #111827 !important;
}

.cuenta-item-name {
  color: #111827 !important;
}

.cuenta-item-qty {
  font-weight: bold;
  color: #E4002B !important;
  margin-right: 0.4rem;
}

.cuenta-item-sub {
  font-weight: bold;
  color: #111827 !important;
}

/* Print Button and Header Layout */
.caja-order-header-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-print-caja {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  color: #374151 !important;
  cursor: pointer;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.btn-print-caja:hover {
  background: #fee2e2 !important;
  border-color: #E4002B !important;
  color: #E4002B !important;
}

/* Controles de Paginación del Historial */
.pagination-controls,
.caja-main .pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: #ffffff !important;
  border-radius: 12px;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

#txtHistorialPage {
  font-size: 0.9rem;
  font-weight: 500;
  color: #4b5563 !important;
}

/* Tarjetas de Domicilio (Caja) */
.domi-card {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

.domi-card.en-camino {
  border-left: 4px solid #2563eb !important;
}

.domi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #e5e7eb !important;
  padding-bottom: 0.4rem;
}

.domi-card-title {
  color: #E4002B !important;
  font-size: 1.05rem;
  font-weight: bold;
}

.domi-card.en-camino .domi-card-title {
  color: #2563eb !important;
}

.domi-card-time {
  font-size: 0.8rem;
  color: #6b7280 !important;
}

.domi-card-body {
  font-size: 0.9rem;
  color: #111827 !important;
  line-height: 1.4;
}

.domi-card-items {
  font-size: 0.85rem;
  color: #4b5563 !important;
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domi-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 5px;
}

.domi-card-select {
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  flex: 1;
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 9999px;
  color: #111827 !important;
  outline: none;
}

.domi-card-btn-icon {
  padding: 0.35rem 0.8rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: bold;
}

.domi-card-btn-icon.success {
  background: #16a34a !important;
  color: white;
}

.domi-card-btn-icon.success:hover {
  background: #15803d !important;
}

.domi-card-btn-icon.warning {
  background: #d97706 !important;
  color: white;
}

.domi-card-btn-icon.warning:hover {
  background: #b45309 !important;
}

/* ==========================================
   UTILITY HELPER CLASSES FOR TICKETS
   ========================================== */
.caja-order-elapsed {
  font-weight: bold;
  color: #E4002B !important;
  margin-right: 0.5rem;
  font-size: 0.95rem;
}

.caja-order-item-cocina {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: #111827 !important;
}

.caja-item-qty-cocina {
  font-size: 1.15rem;
  color: #E4002B !important;
  font-weight: bold;
  margin-right: 0.4rem;
}

.caja-item-name-entregado {
  text-decoration: line-through;
  opacity: 0.5;
}

.caja-item-entregado-label {
  font-size: 0.8rem;
  color: #6b7280 !important;
  font-style: italic;
}

.caja-item-notes-cocina {
  font-size: 0.9rem;
  color: #b45309 !important;
  display: block;
  margin-left: 1.5rem;
  font-style: italic;
  font-weight: normal;
}

.opacity-50 {
  opacity: 0.5;
}

.caja-order-card.in-kitchen {
  border-left: 4px solid #d97706 !important;
}

.caja-order-title.cocina-size {
  font-size: 1.25rem;
  color: #111827 !important;
}

.caja-order-body-cocina {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.caja-order-cliente {
  font-size: 0.9rem;
  color: #111827 !important;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.caja-order-items-cocina {
  border-top: 1px dashed #e5e7eb !important;
  padding-top: 0.5rem;
}

.caja-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.caja-order-status-cooking-badge {
  font-size: 0.85rem;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  background: #fef3c7 !important;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  width: 100%;
  text-align: center;
  font-weight: 600;
}

/* ========================================================
   ESTILOS DE TURNO DE CAJA & MODALES DE ARQUEO
   ======================================================== */

.caja-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.caja-turno-widget {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.caja-turno-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.caja-turno-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-caja-cerrada {
  background: #ef4444;
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
  font-weight: bold;
}

.badge-caja-abierta {
  background: #16a34a;
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
  font-weight: bold;
}

.caja-turno-time {
  font-size: 0.8rem;
  color: #4b5563 !important;
}

.caja-turno-totals {
  font-size: 0.85rem;
  font-weight: bold;
  color: #111827 !important;
  margin-top: 0.1rem;
}

.caja-turno-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-caja-abrir {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
}

.btn-caja-movimiento {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border: 1px solid #d1d5db !important;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
}

.btn-caja-movimiento:hover {
  background: #e5e7eb !important;
  color: #111827 !important;
}

.btn-caja-cerrar {
  background: #E4002B !important;
  border-color: #E4002B !important;
  color: #ffffff !important;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
}

/* Visibilidad de botones del Turno de Caja por clase en Widget */
.caja-turno-widget.turno-abierta #btnAbrirCajaHeader {
  display: none !important;
}
.caja-turno-widget.turno-abierta #btnMovimientoCajaHeader,
.caja-turno-widget.turno-abierta #btnCerrarCajaHeader {
  display: inline-block !important;
}

.caja-turno-widget.turno-cerrada #btnAbrirCajaHeader {
  display: inline-block !important;
}
.caja-turno-widget.turno-cerrada #btnMovimientoCajaHeader,
.caja-turno-widget.turno-cerrada #btnCerrarCajaHeader {
  display: none !important;
}

.caja-modal-sm {
  max-width: 500px;
  width: 95%;
}

.caja-modal-md {
  max-width: 620px;
  width: 95%;
}

.caja-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
}

.caja-modal-form-scrollable {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
  max-height: 80vh;
  overflow-y: auto;
}

.caja-modal-description {
  color: #4b5563 !important;
  font-size: 0.9rem;
  margin: 0;
}

.caja-input-label {
  font-weight: bold;
  font-size: 0.9rem;
  color: #374151 !important;
}

.caja-input-label-white {
  font-weight: bold;
  font-size: 0.95rem;
  color: #111827 !important;
}

.input-monto-base {
  font-size: 1.2rem;
  font-weight: bold;
  color: #16a34a !important;
}

.select-movimiento-tipo {
  font-weight: bold;
}

.input-monto-movimiento {
  font-size: 1.1rem;
  font-weight: bold;
}

.caja-modal-card input,
.caja-modal-card select,
.caja-modal-card textarea {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #111827 !important;
  border-radius: 8px;
  padding: 0.5rem;
}

.caja-modal-card input:focus,
.caja-modal-card select:focus,
.caja-modal-card textarea:focus {
  border-color: #E4002B !important;
  box-shadow: 0 0 0 2px rgba(228, 0, 43, 0.1) !important;
}

.caja-modal-footer-btns {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-confirm-abrir {
  background-color: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  font-weight: bold;
}

.btn-confirm-cerrar {
  background-color: #E4002B !important;
  border-color: #E4002B !important;
  color: #ffffff !important;
  font-weight: bold;
}

.flex-1 {
  flex: 1;
}

.flex-1-2 {
  flex: 1.2;
}

/* Desglose Arqueo */
.caja-desglose-box {
  background: #f9fafb !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #111827 !important;
}

.caja-desglose-row {
  display: flex;
  justify-content: space-between;
  color: #374151 !important;
}

.val-white {
  color: #111827 !important;
}

.val-green {
  color: #16a34a !important;
}

.val-blue {
  color: #2563eb !important;
}

.val-red {
  color: #dc2626 !important;
}

.val-purple {
  color: #9333ea !important;
}

.val-amber {
  color: #d97706 !important;
}

.val-muted {
  color: #6b7280 !important;
}

.caja-desglose-total {
  display: flex;
  justify-content: space-between;
  border-top: 1px dashed #e5e7eb !important;
  padding-top: 0.4rem;
  margin-top: 0.2rem;
  font-size: 1.1rem;
  font-weight: bold;
  color: #E4002B !important;
}

.caja-desglose-hr {
  border: 0;
  border-top: 1px solid #e5e7eb !important;
  margin: 0.5rem 0;
}

.caja-arqueo-input-box {
  background: #f9fafb !important;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb !important;
}

.input-efectivo-declarado {
  font-size: 1.3rem;
  font-weight: bold;
  text-align: right;
  color: #E4002B !important;
}

.caja-arqueo-resultado-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e5e7eb !important;
  color: #111827 !important;
}

.badge-diferencia-arqueo {
  font-size: 1.1rem;
  font-weight: bold;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: #f3f4f6;
  color: #111827;
}

.badge-diferencia-arqueo.exacto {
  background: #16a34a !important;
  color: #ffffff !important;
}

.badge-diferencia-arqueo.sobrante {
  background: #2563eb !important;
  color: #ffffff !important;
}

.badge-diferencia-arqueo.faltante {
  background: #dc2626 !important;
  color: #ffffff !important;
}

/* KPIs de Venta en Caja Historial */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.caja-main .card.metric-card {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px;
  padding: 1.2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
  color: #111827 !important;
}

.caja-main .metric-card-title {
  font-size: 0.85rem;
  color: #4b5563 !important;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.caja-main .metric-card-value {
  font-size: 1.5rem;
  font-weight: 800;
}

.caja-main .metric-card-value.total { color: #E4002B !important; }
.caja-main .metric-card-value.neto { color: #16a34a !important; }
.caja-main .metric-card-value.domi { color: #2563eb !important; }
.caja-main .metric-card-value.propina { color: #7c3aed !important; }
.caja-main .metric-card-value.pending { color: #d97706 !important; }

/* Tabla Historial en Caja */
.caja-main .table-responsive {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
  overflow: hidden;
}

.caja-main .admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.caja-main .admin-table th {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #e5e7eb !important;
  background: #f9fafb !important;
  font-weight: 600;
  color: #4b5563 !important;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.caja-main .admin-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #f3f4f6 !important;
  color: #111827 !important;
  vertical-align: middle;
  background: #ffffff !important;
}

.caja-main .admin-table tr:last-child td {
  border-bottom: none !important;
}

.caja-main .admin-table tbody tr:hover td {
  background-color: #f9fafb !important;
}
