/* ============================
   DESIGN TOKENS
   ============================ */
:root {
  /* Sidebar */
  --sidebar-bg: #0F1A3E;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-active: rgba(79, 140, 255, 0.18);
  --sidebar-active-border: #4F8CFF;
  --sidebar-width: 250px;

  /* Brand Accent */
  --accent: #4F8CFF;
  --accent-hover: #3A75E8;
  --accent-light: rgba(79, 140, 255, 0.10);
  --accent-glow: rgba(79, 140, 255, 0.30);

  /* Surfaces */
  --bg: #F0F2F8;
  --surface: #FFFFFF;
  --surface-border: #E2E6EF;
  --surface-hover: #F7F8FC;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #5F6B80;
  --text-muted: #94A0B8;
  --text-inverse: #FFFFFF;

  /* Status Colors */
  --status-pending-bg: #FFF7ED;
  --status-pending-text: #D97706;
  --status-pending-border: #FED7AA;

  --status-prep-bg: #F3E8FF;
  --status-prep-text: #7C3AED;
  --status-prep-border: #DDD6FE;

  --status-progress-bg: #EFF6FF;
  --status-progress-text: #2563EB;
  --status-progress-border: #BFDBFE;

  --status-paid-bg: #ECFDF5;
  --status-paid-text: #059669;
  --status-paid-border: #A7F3D0;

  --status-done-bg: #F3F4F6;
  --status-done-text: #6B7280;
  --status-done-border: #D1D5DB;

  /* Misc */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
  --transition: 0.2s ease;
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================
   RESET & BASE
   ============================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================
   CUSTOM SCROLLBAR
   ============================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c8cdd8;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a8b8;
}

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  background-image: linear-gradient(180deg, #0F1A3E 0%, #162350 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 22px 32px;
}

.brand-icon {
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-inverse);
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.nav-item:hover .nav-icon {
  opacity: 0.85;
}

/* Sidebar Footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.user-avatar:hover {
  border-color: var(--primary);
}

.avatar-edit-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 50%;
}

.user-avatar:hover .avatar-edit-overlay {
  opacity: 1;
}

.avatar-edit-overlay svg {
  width: 18px;
  height: 18px;
  color: white;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
}

.user-role {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  margin-top: 1px;
}

/* Logout Button */
.btn-logout {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #F87171;
}

/* ============================
   SIDEBAR COLLAPSE TOGGLE
   ============================ */
.sidebar-collapse-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 6px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Arrow rotates when collapsed */
.sidebar.collapsed .sidebar-collapse-btn {
  transform: rotate(180deg);
}

/* ============================
   SIDEBAR COLLAPSED STATE
   ============================ */
.sidebar {
  transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  white-space: nowrap;
}

.sidebar.collapsed {
  width: 68px;
}

/* Hide text labels when collapsed */
.sidebar.collapsed .brand-name,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-item span:not(.nav-icon) {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
  display: none;
}

/* Center nav items when collapsed */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
  border-left-color: transparent !important;
  overflow: visible;
}

.sidebar.collapsed .nav-item.active {
  background: var(--sidebar-active);
}

/* Tooltip on hover when collapsed */
.sidebar.collapsed .nav-item {
  position: relative;
}

.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
}

/* Keep icon visible and centered */
.sidebar.collapsed .nav-icon {
  opacity: 0.7;
}

/* Footer: hide user info, center avatar */
.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 18px 0;
}

.sidebar.collapsed .btn-logout {
  display: none;
}

/* Brand: center icon when collapsed */
.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 26px 0 32px;
}

.sidebar.collapsed .sidebar-collapse-btn {
  display: none;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.sidebar-overlay.visible {
  display: block;
}

/* ============================
   MAIN CONTENT
   ============================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 0 36px 40px;
  min-height: 100vh;
  transition: margin-left 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.sidebar-collapsed {
  margin-left: 68px;
}


/* ============================
   TOP BAR
   ============================ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background var(--transition);
}

.menu-toggle:hover {
  background: var(--surface-border);
}

.page-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-datetime {
  font-size: 0.85rem;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: 0.3px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 9px 16px;
  width: 280px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary);
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 9px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.icon-btn:hover {
  background: var(--surface-hover);
  border-color: #c0c8d8;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  border: 2px solid var(--surface);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }
}

.current-time {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 8px 14px;
  border-radius: 10px;
  text-align: center;
}

/* ============================
   STAT CARDS ROW
   ============================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-card:nth-child(1)::after {
  background: var(--accent);
}

.stat-card:nth-child(2)::after {
  background: var(--status-pending-text);
}

.stat-card:nth-child(3)::after {
  background: var(--status-progress-text);
}

.stat-card:nth-child(4)::after {
  background: var(--status-paid-text);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon--total {
  background: var(--accent-light);
  color: var(--accent);
}

.stat-icon--pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
}

.stat-icon--progress {
  background: var(--status-progress-bg);
  color: var(--status-progress-text);
}

.stat-icon--done {
  background: var(--status-paid-bg);
  color: var(--status-paid-text);
}

.stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.stat-value {
  font-size: clamp(1rem, 1.1vw + 0.5rem, 1.25rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  transition: transform 0.25s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================
   FILTERS BAR
   ============================ */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 4px;
}

.filter-tab {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.filter-tab:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 140, 255, 0.30);
}

.filter-tab.active .filter-dot {
  background: rgba(255, 255, 255, 0.8);
}

.filter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-dot--all {
  background: var(--text-muted);
}

.filter-dot--pendiente {
  background: var(--status-pending-text);
}

.filter-dot--en-curso {
  background: var(--status-progress-text);
}

.filter-dot--pagado {
  background: var(--status-paid-text);
}

.filter-dot--finalizado {
  background: var(--status-done-text);
}

/* ============================
   BUTTONS
   ============================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 24px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 10px rgba(79, 140, 255, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 18px rgba(79, 140, 255, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-glow {
  animation: btn-subtle-glow 3s ease-in-out infinite;
}

@keyframes btn-subtle-glow {

  0%,
  100% {
    box-shadow: 0 2px 10px rgba(79, 140, 255, 0.25);
  }

  50% {
    box-shadow: 0 2px 20px rgba(79, 140, 255, 0.40);
  }
}

.btn-glow:hover {
  animation: none;
}

/* Export Button */
.filters-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-export:hover {
  border-color: #059669;
  color: #059669;
  background: #ECFDF5;
}

.btn-export:active {
  transform: scale(0.97);
}

.btn-export svg {
  flex-shrink: 0;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: #c0c8d8;
}

/* ============================
   ORDERS TABLE
   ============================ */
.orders-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table thead th {
  text-align: left;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 14px 20px;
  border-bottom: 1px solid var(--surface-border);
  white-space: nowrap;
  background: #FAFBFE;
}

.orders-table tbody tr {
  border-bottom: 1px solid var(--surface-border);
  transition: background var(--transition);
}

.orders-table tbody tr:last-child {
  border-bottom: none;
}

.orders-table tbody tr:hover {
  background: #F5F7FC;
}

.orders-table tbody td {
  padding: 10px 16px;
  font-size: 0.88rem;
  vertical-align: middle;
  white-space: nowrap;
}

/* Row animation */
.orders-table tbody tr {
  animation: rowFadeIn 0.3s ease both;
}

@keyframes rowFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Order Number */
.order-number {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

/* Type badge */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-hover);
  padding: 4px 10px;
  border-radius: 6px;
}

.type-badge svg {
  opacity: 0.65;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid transparent;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge--pendiente {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
  border-color: var(--status-pending-border);
}

.status-badge--pendiente::before {
  background: var(--status-pending-text);
}

.status-badge--en-preparacion {
  background: var(--status-prep-bg);
  color: var(--status-prep-text);
  border-color: var(--status-prep-border);
}

.status-badge--en-preparacion::before {
  background: var(--status-prep-text);
}

.status-badge--en-curso {
  background: var(--status-progress-bg);
  color: var(--status-progress-text);
  border-color: var(--status-progress-border);
}

.status-badge--en-curso::before {
  background: var(--status-progress-text);
}

.status-badge--pagado {
  background: var(--status-paid-bg);
  color: var(--status-paid-text);
  border-color: var(--status-paid-border);
}

.status-badge--pagado::before {
  background: var(--status-paid-text);
}

.status-badge--cancelado {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

.status-badge--cancelado::before {
  background: #DC2626;
}

.status-badge--finalizado {
  background: #F3F4F6;
  color: #374151;
  border-color: #D1D5DB;
}

.status-badge--finalizado::before {
  background: #374151;
}

/* Amount */
.order-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* Customer */
.customer-name {
  font-weight: 500;
}

/* Time elapsed */
.time-elapsed {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
}

.time-elapsed.time-warn {
  color: var(--status-pending-text);
  font-weight: 700;
}

/* Action buttons */
.actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

.catalog-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.5rem;
  border: 2px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.action-btn {
  background: none;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xs);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.action-btn--finish {
  border-color: var(--status-paid-border);
  color: var(--status-paid-text);
  background: var(--status-paid-bg);
  font-weight: 600;
}

.action-btn--finish:hover {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 10px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
}

.empty-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

/* ============================
   SECTION PLACEHOLDER
   ============================ */
.section-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.placeholder-card {
  text-align: center;
  padding: 60px 40px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  max-width: 440px;
}

.placeholder-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--accent-light);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.placeholder-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.placeholder-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.placeholder-features {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.placeholder-tag {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
}

/* ============================
   MODAL
   ============================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.18s ease;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 500px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal--detail {
  width: 480px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 0;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--surface-border);
  color: var(--text-primary);
}

.modal-body {
  padding: 16px 22px 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: inherit;
  font-size: 0.92rem;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 11px 16px;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
}

/* Detail modal */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--surface-border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================
   TOAST NOTIFICATIONS
   ============================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon--success {
  background: var(--status-paid-bg);
  color: var(--status-paid-text);
}

.toast-icon--info {
  background: var(--accent-light);
  color: var(--accent);
}

.toast-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(60px);
  }
}

/* ============================
   ANIMATIONS
   ============================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1200px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 0 18px 28px;
  }

  .menu-toggle {
    display: flex;
  }

  .search-box {
    width: 200px;
  }

  .page-subtitle {
    display: none;
  }
}

@media (max-width: 700px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .orders-table-wrapper {
    overflow-x: auto;
  }

  .search-box {
    display: none;
  }

  .current-time {
    display: none;
  }

  .top-bar {
    padding: 16px 0 12px;
  }
}

@media (max-width: 500px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 16px;
  }
}

/* ============================
   MENÚ SECTION — Categories & Products
   ============================ */

/* Menu Header */
.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.menu-header-count {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Empty state */
.menu-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.menu-empty svg {
  margin-bottom: 16px;
  opacity: 0.3;
}

.menu-empty h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.menu-empty p {
  font-size: 0.88rem;
}

/* Category Card */
.menu-cat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.menu-cat:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* Drag states */
.menu-cat.dragging {
  opacity: 0.45;
  transform: scale(0.98);
  box-shadow: 0 8px 24px rgba(79, 140, 255, 0.18);
}

.menu-cat.drag-over {
  border-color: #4F8CFF;
  border-top: 2px solid #4F8CFF;
  transform: translateY(-2px);
}

/* Drag handle */
.menu-cat-drag {
  display: flex;
  align-items: center;
  color: #c7cdd8;
  cursor: grab;
  padding: 4px 2px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.menu-cat-drag:hover {
  color: #4F8CFF;
  background: rgba(79, 140, 255, 0.08);
}

.menu-cat-drag:active {
  cursor: grabbing;
}

/* Category Header */
.menu-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 12px;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.04) 0%, rgba(79, 140, 255, 0.02) 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.menu-cat-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

.menu-cat-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.menu-cat-arrow.expanded {
  transform: rotate(90deg);
}

.menu-cat-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.menu-cat-name {
  background: none;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: 6px;
  outline: none;
  flex: 1;
  min-width: 0;
  max-width: 300px;
  transition: all 0.2s;
  cursor: text;
}

.menu-cat-name:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--card-border);
}

.menu-cat-name:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.12);
}

/* Category Right side */
.menu-cat-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.menu-cat-count {
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  min-width: 28px;
  text-align: center;
}

/* Add product button */
.btn-add-product {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-add-product:hover {
  background: #3A75E8;
  transform: translateY(-1px);
}

/* Three dots menu button */
.btn-menu-dots {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-menu-dots:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

/* ---- Products List ---- */
.menu-products {
  border-top: 1px solid var(--card-border);
}

.menu-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 12px 50px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  transition: background 0.15s;
  gap: 12px;
}

.menu-product:last-child {
  border-bottom: none;
}

.menu-product:hover {
  background: rgba(79, 140, 255, 0.02);
}

.menu-product-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

/* Product thumbnail */
.menu-product-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: var(--bg-main);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
}

.menu-product-thumb.no-img svg {
  opacity: 0.25;
}

.menu-product-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu-product-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-product-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

.menu-product-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.menu-product-price {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 70px;
  text-align: right;
}

/* Visibility toggle */
.btn-visibility {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
}

.btn-visibility.visible {
  color: var(--accent);
}

.btn-visibility.hidden-prod {
  color: var(--text-muted);
  opacity: 0.4;
}

/* Empty products */
.menu-product-empty {
  padding: 20px 50px;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---- Context Menu ---- */
.ctx-menu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  min-width: 160px;
  animation: ctxFade 0.15s ease;
}

@keyframes ctxFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ctx-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.ctx-menu button:hover {
  background: #f3f4f6;
}

.ctx-menu hr {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 4px 0;
}

/* ---- Slide-in Edit Panel ---- */
.menu-edit-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.menu-edit-panel.open {
  transform: translateX(0);
}

.menu-edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1090;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.menu-edit-panel.open~.menu-edit-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Edit Panel internals */
.edit-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.edit-panel-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
}

.menu-edit-panel .form-group {
  padding: 0 24px;
  margin-bottom: 18px;
}

.menu-edit-panel .form-group:first-of-type {
  margin-top: 20px;
}

.menu-edit-panel label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
}

.menu-edit-panel input[type="text"],
.menu-edit-panel input[type="url"],
.menu-edit-panel input[type="number"],
.menu-edit-panel textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #111827;
  outline: none;
  transition: border-color 0.2s;
}

.menu-edit-panel input:focus,
.menu-edit-panel textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

.menu-edit-panel textarea {
  resize: vertical;
}

/* Image upload section */
.edit-img-section {
  display: flex;
  gap: 18px;
  padding: 20px 24px;
  align-items: flex-start;
}

.edit-img-preview {
  width: 100px;
  height: 100px;
  border-radius: 16px;
  background: #f3f4f6;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #d1d5db;
  transition: all 0.2s;
  cursor: pointer;
  overflow: hidden;
}

.edit-img-preview:hover {
  border-color: var(--accent);
  background-color: rgba(79, 140, 255, 0.04);
}

.edit-img-preview.has-img {
  border-style: solid;
  border-color: transparent;
}

.edit-img-preview.has-img .edit-img-placeholder {
  display: none;
}

.edit-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #9ca3af;
}

.edit-img-placeholder span {
  font-size: 0.7rem;
  font-weight: 600;
}

/* Upload controls */
.edit-img-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-upload-image {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-upload-image:hover:not(:disabled) {
  background: #3A75E8;
  transform: translateY(-1px);
}

.btn-upload-image:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Upload progress bar */
.upload-progress {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  display: none;
}

.upload-progress.active {
  display: block;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #6366F1);
  border-radius: 6px;
  transition: width 0.3s ease;
}

/* URL fallback */
.edit-img-url {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edit-img-url label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 0;
}

.edit-img-url input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  color: #111827;
  outline: none;
}

.edit-img-url input:focus {
  border-color: var(--accent);
}

/* Toggle switch */
.form-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.form-toggle label:first-child {
  margin-bottom: 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: all 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(20px);
}

/* Panel actions */
.edit-panel-actions {
  padding: 20px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.btn-delete-product {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: rgba(239, 68, 68, 0.06);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-product:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ---- Responsive Menu ---- */
@media (max-width: 768px) {
  .menu-product {
    padding-left: 18px;
  }

  .menu-cat-name {
    width: 140px;
  }

  .menu-product-desc {
    max-width: 150px;
  }

  .menu-edit-panel {
    width: 100vw;
  }
}

/* ============================
   POS VIEW — Order Type Dropdown
   ============================ */
.new-order-dropdown-wrapper {
  position: relative;
}

.order-type-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .15), 0 1px 4px rgba(0, 0, 0, .08);
  min-width: 220px;
  padding: 6px;
  z-index: 100;
  animation: dropIn .2s ease;
}

.order-type-dropdown.open {
  display: block;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-type-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  color: #1f2937;
  transition: background .15s;
}

.order-type-option:hover {
  background: #f0f5ff;
}

.ot-icon {
  font-size: 1.2rem;
}

.ot-label {
  flex: 1;
  text-align: left;
  font-weight: 500;
}

.ot-tag {
  font-size: .7rem;
  font-weight: 600;
  background: #EBF5FF;
  color: #2563EB;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ============================
   POS VIEW — Top Bar
   ============================ */
.pos-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0;
}

.pos-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: #4F8CFF;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .15s;
}

.pos-back-btn:hover {
  background: #f0f5ff;
}

.pos-order-type-badge {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 8px;
  color: #fff;
  background: #3B82F6;
}

.pos-order-type-badge.type-a-domicilio {
  background: #F59E0B;
  color: #1f2937;
}

.pos-order-type-badge.type-para-llevar {
  background: #10B981;
}

.pos-order-type-badge.type-en-el-local {
  background: #3B82F6;
}

.pos-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 6px 12px;
  flex: 1;
  max-width: 300px;
  margin-left: auto;
}

.pos-search svg {
  color: #9ca3af;
  flex-shrink: 0;
}

.pos-search input {
  border: none;
  background: none;
  outline: none;
  font-size: .85rem;
  width: 100%;
  color: #1f2937;
}

/* ============================
   POS VIEW — Layout
   ============================ */
.pos-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
  height: calc(100vh - 170px);
  overflow: hidden;
  /* right side space reserved for the fixed checkout panel */
  padding-right: 390px;
}

/* ---- Category Sidebar ---- */
.pos-sidebar {
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pos-cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: .82rem;
  color: #4b5563;
  transition: background .15s, color .15s;
  text-align: left;
}

.pos-cat-btn:hover {
  background: #f3f4f6;
}

.pos-cat-btn.active {
  background: #EBF5FF;
  color: #2563EB;
  font-weight: 600;
}

.pos-cat-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.pos-cat-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-cat-badge {
  font-size: .7rem;
  background: #e5e7eb;
  color: #6b7280;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.pos-cat-btn.active .pos-cat-badge {
  background: #BFDBFE;
  color: #2563EB;
}

/* ---- Product Grid ---- */
.pos-products {
  overflow-y: auto;
  padding: 16px;
}

.pos-product-group {
  margin-bottom: 20px;
}

.pos-group-title {
  font-size: .85rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f3f4f6;
}

.pos-product-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.pos-product-card {
  background: #fff;
  border: 2px solid #f3f4f6;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  overflow: hidden;
}

.pos-product-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 2px 12px rgba(59, 130, 246, .12);
  transform: translateY(-2px);
}

.pos-product-card.in-cart {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .2);
}

.pos-product-img {
  height: 100px;
  background: #f9fafb;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pos-card-qty {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #3B82F6;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-product-detail {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pos-product-name {
  font-size: .8rem;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-product-price {
  font-size: .8rem;
  font-weight: 700;
  color: #2563EB;
}

.pos-empty-products {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  color: #9ca3af;
}

/* ---- Checkout Panel (fixed right drawer) ---- */
.pos-checkout {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 390px;
  background: #fff;
  border-left: 1px solid #d1d5db;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}

.pos-checkout-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 700;
  color: #1f2937;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  margin: 0;
}

.pos-checkout-title svg {
  width: 16px;
  height: 16px;
  opacity: .6;
}

/* Client Info */
.pos-client-section {
  padding: 8px 14px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pos-client-section.compact {
  padding: 6px 14px;
  gap: 1px;
}

.pos-client-section.compact .pos-field label {
  margin-bottom: 1px;
}

.pos-client-section.compact .pos-field input {
  padding: 5px 8px;
}

.pos-field label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 1px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.pos-field input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: .84rem;
  color: #1f2937;
  background: #fafafa;
  transition: border-color .2s, background .2s;
}

.pos-field input:focus {
  outline: none;
  border-color: #3B82F6;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .08);
}

/* Cart */
.pos-cart-section {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px;
}

.pos-cart-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  font-weight: 700;
  color: #374151;
  padding: 8px 0 4px;
  margin: 0;
}

.pos-cart-title span {
  background: #3B82F6;
  color: #fff;
  font-size: .72rem;
  padding: 0 6px;
  border-radius: 8px;
  line-height: 1.5;
}

.pos-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 10px;
  color: #d1d5db;
  font-size: .78rem;
}

.pos-cart-empty svg {
  width: 28px;
  height: 28px;
  opacity: .4;
}

.pos-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 6px;
}

.pos-cart-item-info {
  flex: 1;
  min-width: 0;
}

.pos-cart-item-name {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-cart-item-price {
  font-size: .78rem;
  color: #6b7280;
}

.pos-cart-item-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pos-qty-btn {
  width: 22px;
  height: 22px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 6px;
  font-size: .84rem;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}

.pos-qty-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.pos-qty-value {
  font-size: .82rem;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
  color: #1f2937;
}

.pos-remove-btn {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: color .15s;
}

.pos-remove-btn:hover {
  color: #EF4444;
}

/* Totals */
.pos-totals {
  padding: 8px 14px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pos-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .84rem;
  color: #6b7280;
}

.pos-grand-total {
  font-size: .95rem;
  font-weight: 800;
  color: #1f2937;
  padding-top: 5px;
  margin-top: 2px;
  border-top: 1.5px solid #e5e7eb;
}

.pos-delivery-input {
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}

.pos-delivery-input input {
  width: 70px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: .84rem;
  text-align: right;
  color: #1f2937;
}

.pos-delivery-input input:focus {
  outline: none;
  border-color: #3B82F6;
}

.pos-totals select {
  padding: 3px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: .84rem;
  color: #1f2937;
  background: #fff;
  cursor: pointer;
}

/* Action Buttons */
.pos-checkout-actions {
  display: flex;
  gap: 6px;
  padding: 8px 14px 10px;
  border-top: 1px solid #e5e7eb;
}

.pos-btn-cancel,
.pos-btn-pending,
.pos-btn-pay {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border: none;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .2px;
  transition: background .2s, transform .12s, box-shadow .2s;
}

.pos-btn-cancel svg,
.pos-btn-pending svg,
.pos-btn-pay svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.pos-btn-cancel {
  background: #FEF2F2;
  color: #DC2626;
}

.pos-btn-cancel:hover {
  background: #FEE2E2;
  box-shadow: 0 2px 8px rgba(220, 38, 38, .12);
}

.pos-btn-cancel:active {
  transform: scale(.96);
}

.pos-btn-pending {
  background: #FFFBEB;
  color: #D97706;
}

.pos-btn-pending:hover {
  background: #FEF3C7;
  box-shadow: 0 2px 8px rgba(217, 119, 6, .12);
}

.pos-btn-pending:active {
  transform: scale(.96);
}

.pos-btn-pay {
  background: #059669;
  color: #fff;
}

.pos-btn-pay:hover {
  background: #047857;
  box-shadow: 0 2px 10px rgba(5, 150, 105, .25);
}

.pos-btn-pay:active {
  transform: scale(.96);
}

/* Detail Items Table */
.detail-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  margin: 6px 0;
}

.detail-items-table th {
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  padding: 4px 8px;
  border-bottom: 1px solid #e5e7eb;
  font-size: .75rem;
  text-transform: uppercase;
}

.detail-items-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.detail-total {
  font-weight: 800 !important;
  font-size: .95rem !important;
}

.detail-actions {
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  margin-top: 8px;
}


/* ---- Order Action Buttons ---- */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  background: #f3f4f6;
  color: #6b7280;
}

.btn-action svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.btn-action:active {
  transform: scale(.93);
  box-shadow: none;
}

/* Pay */
.btn-action--pay {
  background: #ECFDF5;
  color: #059669;
}

.btn-action--pay svg {
  stroke: #059669;
}

.btn-action--pay:hover {
  background: #D1FAE5;
}

/* Cancel / Delete */
.btn-action--cancel {
  background: #FEF2F2;
  color: #DC2626;
}

.btn-action--cancel svg {
  stroke: #EF4444;
}

.btn-action--cancel:hover {
  background: #FEE2E2;
}

/* Advance / Finalize */
.btn-action--finalize {
  background: #EFF6FF;
  color: #2563EB;
}

.btn-action--finalize svg {
  stroke: #2563EB;
}

.btn-action--finalize:hover {
  background: #DBEAFE;
}

/* View detail (default) */
.btn-action:not([class*="--"]) {
  background: #F9FAFB;
  color: #9CA3AF;
}

.btn-action:not([class*="--"]) svg {
  stroke: #9CA3AF;
}

.btn-action:not([class*="--"]):hover {
  background: #F3F4F6;
  color: #6B7280;
}

.btn-action:not([class*="--"]):hover svg {
  stroke: #6B7280;
}

/* Print */
.btn-action--print {
  background: #F5F3FF;
  color: #7C3AED;
}

.btn-action--print svg {
  stroke: #7C3AED;
}

.btn-action--print:hover {
  background: #EDE9FE;
}

/* ---- Ventas Module ---- */
.ventas-date-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ventas-date-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ventas-date-group label {
  font-size: .7rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.ventas-date-group input[type="date"] {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: .82rem;
  color: #1f2937;
  background: #fff;
  transition: border-color .2s;
  min-width: 150px;
}

.ventas-date-group input[type="date"]:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .08);
}

.ventas-products-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .8rem;
  color: #6b7280;
}

/* ---- POS Responsive ---- */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
    padding-right: 350px;
  }

  .pos-sidebar {
    display: none;
  }

  .pos-checkout {
    width: 350px;
  }
}

@media (max-width: 768px) {
  .pos-layout {
    grid-template-columns: 1fr;
    padding-right: 0;
    height: auto;
  }

  .pos-checkout {
    position: relative;
    width: 100%;
    box-shadow: none;
    border-left: none;
    border-top: 1px solid #e5e7eb;
  }
}

/* --- Drag & Drop for Menu Products --- */
.menu-product {
  transition: box-shadow 0.2s, transform 0.2s;
}

.menu-product.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.menu-product.drag-over {
  border-top: 2px solid #4F8CFF;
  transform: translateY(-2px);
}

.menu-product-drag {
  display: flex;
  align-items: center;
  color: #c7cdd8;
  cursor: grab;
  padding: 0 8px 0 0;
  transition: color 0.15s;
}

.menu-product-drag:hover {
  color: #4F8CFF;
}

.menu-product-drag:active {
  cursor: grabbing;
}

/* --- Orders Pagination --- */
.orders-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 0 6px;
}

.pag-btn {
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #e5e7eb);
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #4F8CFF;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pag-btn:hover:not(:disabled) {
  background: rgba(79, 140, 255, 0.07);
  border-color: #4F8CFF;
}

.pag-btn:disabled {
  opacity: 0.4;
  cursor: default;
  color: #9ca3af;
}

.pag-info {
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 500;
  user-select: none;
}

/* ============================
   DIGITAL CATALOG (menu.html)
   ============================ */

.catalog-header {
  background: var(--surface);
  padding: 16px 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.catalog-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.catalog-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.catalog-nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 90;
  padding: 12px 20px;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;
  transition: 0s;
}

.catalog-nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
  width: 0;
  height: 0;
}

.catalog-pill,
.nav-pill {
  padding: 8px 16px;
  background: var(--bg);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: 0s;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}

.catalog-pill.active,
.nav-pill.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: 0s;
}

.catalog-pill:hover:not(.active),
.nav-pill:hover:not(.active) {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--surface-border);
  transition: 0s;
}

/* Botón Flotante de WhatsApp */
.btn-whatsapp-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #25D366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: 0s;
}

.btn-whatsapp-floating:hover {
  background-color: #20ba5a;
  transition: 0s;
}

.btn-whatsapp-floating.hidden {
  display: none !important;
}

/* Matriz Granular de Horarios en Configuración */
.cfg-schedule-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--surface-border, #E2E8F0);
  border-radius: var(--radius-sm, 8px);
  background: #FFFFFF;
}

.cfg-schedule-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  font-size: 0.88rem;
}

.cfg-schedule-row {
  border-bottom: 1px solid var(--surface-border, #E2E8F0);
  transition: 0s !important;
}

.cfg-schedule-row:last-child {
  border-bottom: none;
}

.cfg-schedule-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: 0s !important;
}

.cfg-schedule-switch input[type="checkbox"] {
  cursor: pointer;
  width: 17px;
  height: 17px;
  accent-color: var(--accent, #10B981);
  margin: 0;
}

.cfg-day-status-text {
  font-size: 0.82rem;
  font-weight: 600;
  transition: 0s !important;
}

.cfg-day-status-text.is-closed {
  color: var(--text-muted, #94A3B8);
}

.cfg-day-status-text.is-open {
  color: #047857;
}

.cfg-time-open,
.cfg-time-close {
  padding: 7px 10px;
  border: 1px solid var(--surface-border, #E2E8F0);
  border-radius: var(--radius-sm, 6px);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary, #0F172A);
  background: #FFFFFF;
  width: 100%;
  max-width: 135px;
  transition: 0s !important;
}

.cfg-time-open:disabled,
.cfg-time-close:disabled {
  opacity: 0.45;
  background-color: #F8FAFC !important;
  cursor: not-allowed;
  border-color: #E2E8F0 !important;
  color: #94A3B8 !important;
}

/* Badge de Horario en Catálogo */
.catalog-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  transition: 0s !important;
}

.catalog-status-badge.open {
  background-color: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.catalog-status-badge.closed {
  background-color: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.catalog-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.catalog-section {
  margin-bottom: 40px;
  scroll-margin-top: 140px; /* Offset for sticky nav + header */
}

.catalog-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
  display: inline-block;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 480px) {
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .catalog-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.catalog-card {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.catalog-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.catalog-img-wrapper {
  padding-top: 65%;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.catalog-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catalog-no-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, #e5e7eb 100%);
  color: var(--text-muted);
}

.catalog-info {
  padding: 8px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.catalog-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.catalog-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.catalog-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.catalog-footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--surface-border);
}

.catalog-footer-brand {
  font-weight: 700;
  color: var(--text-secondary);
}



/* ============================
   ESTADÍSTICAS SECTION
   ============================ */

/* ── Filter Bar ── */
.stat-filters-bar {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.stat-filters-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-filter-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--surface-border);
  border-radius: 12px;
  padding: 0 12px 0 10px;
  height: 42px;
  gap: 6px;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.stat-filter-select-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.stat-filter-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  flex-shrink: 0;
  pointer-events: none;
}

.stat-filter-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
  pointer-events: none;
  margin-left: 2px;
}

.stat-filter-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 90px;
  padding-right: 2px;
}

.stat-filter-select option {
  color: var(--text-primary);
  background: var(--surface);
}

/* Apply button */
.stat-btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  height: 42px;
  transition: all var(--transition);
  box-shadow: 0 2px 10px rgba(79, 140, 255, 0.28);
  white-space: nowrap;
}

.stat-btn-apply:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 18px rgba(79, 140, 255, 0.38);
  transform: translateY(-1px);
}

.stat-btn-apply:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(79, 140, 255, 0.2);
}

/* Clear button */
.stat-btn-clear {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1.5px solid var(--surface-border);
  border-radius: 12px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  height: 42px;
  transition: all var(--transition);
  white-space: nowrap;
}

.stat-btn-clear:hover {
  border-color: #DC2626;
  color: #DC2626;
  background: #FEF2F2;
}

.stat-btn-clear:active {
  transform: scale(0.97);
}

/* ── Charts ── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-span-2 {
  grid-column: span 2;
}

.chart-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* ── Top Products Section ── */
.top-products-section {
  margin-top: 0;
}

.top-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.top-products-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-products-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent-light), rgba(79,140,255,0.05));
  border: 1px solid rgba(79,140,255,0.2);
  border-radius: 10px;
  color: var(--accent);
  flex-shrink: 0;
}

.top-products-badge {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(79,140,255,0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.top-products-body {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  align-items: start;
}

.top-products-chart-wrap {
  min-width: 0;
}

.top-products-table-wrap {
  min-width: 0;
  overflow: visible;
}

.top-products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;
}

.top-products-table thead th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 7px 8px;
  border-bottom: 2px solid var(--surface-border);
  white-space: nowrap;
  overflow: hidden;
  background: #FAFBFE;
}

.top-products-table thead th:first-child {
  border-radius: 8px 0 0 0;
  width: 30px;
}

.top-products-table thead th:nth-child(2) {
  width: auto;
}

.top-products-table thead th:nth-child(3) {
  width: 58px;
  text-align: center;
}

.top-products-table thead th:last-child {
  border-radius: 0 8px 0 0;
  text-align: right;
  width: 96px;
}

.top-products-table tbody tr {
  border-bottom: 1px solid var(--surface-border);
  transition: background var(--transition);
  animation: rowFadeIn 0.3s ease both;
}

.top-products-table tbody tr:last-child {
  border-bottom: none;
}

.top-products-table tbody tr:hover {
  background: #F5F7FC;
}

.top-products-table tbody td {
  padding: 7px 8px;
  vertical-align: middle;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-products-table tbody td:nth-child(2) {
  font-weight: 500;
}

.top-products-table tbody td:nth-child(3) {
  text-align: center;
}

.top-products-table tbody td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--status-paid-text);
  white-space: nowrap;
}

/* rank badge */
.top-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface-border);
  color: var(--text-muted);
}

.top-rank-badge--1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  box-shadow: 0 2px 6px rgba(255, 185, 0, 0.4);
}
.top-rank-badge--2 {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: #fff;
}
.top-rank-badge--3 {
  background: linear-gradient(135deg, #CD7F32, #B06C24);
  color: #fff;
}

.top-qty-pill {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

.top-products-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 12px;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-span-2 {
    grid-column: span 1;
  }
  .top-products-body {
    grid-template-columns: 1fr;
  }
}