/* ========== CONTENEDOR PRINCIPAL ========== */
.fma-chef-panel {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ========== HEADER ========== */
.fma-chef-header {
  text-align: center;
  margin-bottom: 30px;
}

.fma-chef-header h1 {
  font-size: 2.5rem;
  margin: 0 0 20px 0;
  color: #1f2937;
}

.fma-chef-subtitle {
  font-size: 1.1rem;
  color: #6b7280;
  margin: 15px 0 25px 0;
}

/* ========== SELECTOR DE EVENTO (DROPDOWN) ========== */
.fma-event-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.fma-event-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #374151;
  white-space: nowrap;
}

.fma-event-dropdown {
  padding: 10px 40px 10px 16px;
  border: 2px solid #6366f1;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: #4f46e5;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 280px;
  max-width: 520px;
}

.fma-event-dropdown:hover,
.fma-event-dropdown:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
  outline: none;
}

/* ========== ESTADÍSTICAS ========== */
.fma-chef-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.fma-stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  border: 2px solid #e5e7eb;
  transition: transform 0.2s;
}

.fma-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.fma-stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: bold;
  color: #2563eb;
  line-height: 1;
  margin-bottom: 8px;
}

.fma-stat-label {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fma-stat-vegetarian { border-color: #10b981; }
.fma-stat-vegetarian .fma-stat-number { color: #10b981; }

.fma-stat-vegan { border-color: #059669; }
.fma-stat-vegan .fma-stat-number { color: #059669; }

.fma-stat-allergies { border-color: #f59e0b; }
.fma-stat-allergies .fma-stat-number { color: #f59e0b; }

/* ========== FILTROS DE DIETA ========== */
.fma-chef-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 30px;
}

.fma-filter-btn {
  padding: 10px 20px;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  transition: all 0.2s;
}

.fma-filter-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.fma-filter-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

#fma-search {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  padding: 10px 15px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
}

#fma-search:focus {
  outline: none;
  border-color: #2563eb;
}

/* ========== LOADING ========== */
.fma-chef-loading {
  text-align: center;
  padding: 60px 20px;
}

.fma-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== GRID DE MESAS ========== */
#fma-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.fma-table-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  border: 2px solid #e5e7eb;
  transition: transform 0.2s;
}

.fma-table-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.fma-table-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fma-table-header h3 { margin: 0; font-size: 1.5rem; }

.fma-table-count {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
}

/* ========== ASIENTOS ========== */
.fma-seats-list {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fma-seat-item {
  background: #f9fafb;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #d1d5db;
  transition: all 0.2s;
}

.fma-seat-item:hover { background: #f3f4f6; transform: translateX(3px); }

.fma-seat-item.fma-diet-vegetarian { border-left-color: #10b981; background: #f0fdf4; }
.fma-seat-item.fma-diet-vegan      { border-left-color: #059669; background: #ecfdf5; }
.fma-seat-item.fma-has-allergies   { border: 2px solid #f59e0b; background: #fffbeb; }

.fma-seat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.fma-seat-number { font-weight: 600; color: #374151; font-size: 0.875rem; }

.fma-seat-type {
  background: #e5e7eb;
  color: #6b7280;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.fma-seat-name { font-size: 1.125rem; font-weight: 700; color: #1f2937; margin-bottom: 8px; }

.fma-seat-diet {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 6px;
}

.fma-diet-icon { font-size: 1.25rem; }

.fma-seat-allergies {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: #fef3c7;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 0.875rem;
  color: #92400e;
  font-weight: 500;
}

.fma-allergy-icon { font-size: 1rem; flex-shrink: 0; }

/* ========== NO RESULTS ========== */
.fma-no-results {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
  font-size: 1.125rem;
}

/* ========== FOOTER ========== */
.fma-chef-footer {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e5e7eb;
}

.fma-btn-refresh,
.fma-btn-print {
  padding: 12px 24px;
  border: 2px solid #2563eb;
  background: white;
  color: #2563eb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
}

.fma-btn-refresh:hover,
.fma-btn-print:hover { background: #2563eb; color: white; }

/* ========== PRINT STYLES ========== */
@media print {
  .fma-event-selector,
  .fma-chef-filters,
  .fma-chef-footer { display: none !important; }

  .fma-table-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }

  #fma-tables-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .fma-chef-header h1 { font-size: 1.75rem; }

  .fma-event-selector { flex-direction: column; align-items: stretch; }

  .fma-event-dropdown {
    min-width: 100%;
    max-width: 100%;
  }

  .fma-chef-stats { grid-template-columns: repeat(2, 1fr); }
  #fma-tables-grid { grid-template-columns: 1fr; }
  .fma-chef-filters { flex-direction: column; }

  .fma-filter-btn,
  #fma-search { width: 100%; max-width: none; }

  .fma-chef-footer { flex-direction: column; }
  .fma-btn-refresh,
  .fma-btn-print { width: 100%; }
}

@media (max-width: 480px) {
  .fma-chef-panel { padding: 10px; }
  .fma-stat-card { padding: 15px 10px; }
  .fma-stat-number { font-size: 2rem; }
  .fma-table-header h3 { font-size: 1.25rem; }
}
