/* src/css/pages/admin.css */

.admin-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--background);
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background-color: var(--secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem;
  flex-shrink: 0;
}

.admin-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: bold;
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
}

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

.sidebar-item-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  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: all 0.2s ease;
}

.sidebar-item-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--foreground);
}

.sidebar-item-btn.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border);
}

/* Main Content area */
.admin-main {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
  height: 100vh;
  background: radial-gradient(circle at 80% 20%, rgba(234, 88, 12, 0.03) 0%, transparent 50%), var(--background);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.admin-title-box h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--foreground);
  margin-bottom: 0.3rem;
}

.admin-title-box p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Pestañas de Contenido (Tabs) */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: flex;
}

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

/* Controles superiores (Buscador, Botón de Agregar) */
.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: rgba(30, 30, 30, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  padding: 1rem 1.5rem;
  border-radius: 16px;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
}



/* Celdas especiales */
.product-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.product-img-mini {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background-color: #333;
  border: 1px solid var(--border);
}

.role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: bold;
  text-align: center;
}

.role-badge.admin { background: rgba(234, 88, 12, 0.15); color: var(--primary); border: 1px solid rgba(234, 88, 12, 0.3); }
.role-badge.cajero { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.role-badge.mesero { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.role-badge.cocinero { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.role-badge.cliente { background: rgba(156, 163, 175, 0.15); color: #9ca3af; border: 1px solid rgba(156, 163, 175, 0.3); }

/* Switches de disponibilidad (toggles) */
.switch-container {
  display: inline-flex;
  align-items: center;
}

.switch-input {
  display: none;
}

.switch-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  background-color: #3f3f46;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.switch-label::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-input:checked + .switch-label {
  background-color: #22c55e;
}

.switch-input:checked + .switch-label::after {
  transform: translateX(22px);
}

/* Botones de acción en tablas */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--foreground);
}

.btn-action.edit:hover {
  border-color: #60a5fa;
  color: #60a5fa;
}

.btn-action.delete:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Modal Form styling (Admin) */
.admin-modal-card {
  max-width: 550px;
  width: 95%;
  background: #18181c;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.modal-header-actions h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--accent);
}

/* Image preview box in Form */
.image-upload-preview-container {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed var(--border);
}

.image-preview-large {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  background-color: #222;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.image-upload-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Responsive adjustment */
@media (max-width: 900px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 1rem;
  }
  .admin-logo {
    margin-bottom: 1rem;
    border-bottom: none;
    padding-bottom: 0;
  }
  .sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  .sidebar-item-btn {
    white-space: nowrap;
  }
  .admin-main {
    padding: 1.5rem;
    height: auto;
    overflow-y: visible;
  }
  .table-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input-wrapper {
    max-width: 100%;
  }
}

/* Badge Styles for Orders History */
.order-type-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  text-align: center;
}

.type-mesa {
  background: rgba(234, 88, 12, 0.1);
  color: var(--accent);
  border: 1px solid rgba(234, 88, 12, 0.3);
}

.type-domicilio {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.type-llevar {
  background: rgba(155, 89, 182, 0.1);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  text-align: center;
}

.status-pendiente {
  background: rgba(234, 179, 8, 0.1);
  color: var(--warning);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-cocina {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-preparando {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.status-listo {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-entregado {
  background: rgba(20, 184, 166, 0.1);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.status-despachado {
  background: rgba(156, 163, 175, 0.1);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-cancelado {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Metric Cards Dashboard Premium Styles */
.metric-card {
  background: rgba(22, 22, 26, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.metric-card:hover {
  transform: translateY(-6px);
  border-color: rgba(234, 88, 12, 0.4);
  box-shadow: 0 12px 40px rgba(234, 88, 12, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

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

/* Controles de Paginación */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

#txtAdminPedidosPage {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

