/**
 * ============================================================
 * DIARIO DE FERMENTACIÓN V2 - ESTILOS
 * ============================================================
 */

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

.mpp-diario {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.mpp-diario-title {
  margin: 0 0 24px 0;
  font-size: 28px;
  font-weight: 600;
  color: #1a1a1a;
}

/* ========================================
   TOOLBAR
   ======================================== */

.mpp-diario-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.mpp-diario-new {
  background: #0066cc;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.mpp-diario-new:hover {
  background: #0052a3;
}

.mpp-diario-new:active {
  transform: scale(0.98);
}

/* ========================================
   TABS
   ======================================== */

.mpp-diario-tabs {
  display: flex;
  gap: 8px;
  background: #f5f5f5;
  padding: 4px;
  border-radius: 8px;
}

.mpp-tab {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.mpp-tab:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

.mpp-tab.is-active {
  background: white;
  color: #0066cc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mpp-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   LISTA DE HORNADAS
   ======================================== */

.mpp-diario-view {
  min-height: 200px;
}

.mpp-diario-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
}

.mpp-diario-day {
  margin-bottom: 32px;
}

.mpp-day-header {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
  text-transform: capitalize;
}

/* Vista por receta */
.mpp-diario-recipe {
  margin-bottom: 32px;
}

.mpp-recipe-header {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #0066cc;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.mpp-recipe-count {
  font-size: 14px;
  font-weight: 400;
  color: #666;
}

/* ========================================
   TARJETA DE HORNADA (COMPACTA)
   ======================================== */

.mpp-batch-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.mpp-batch-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: #ccc;
}

.mpp-batch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  user-select: none;
}

.mpp-batch-header:hover {
  background: rgba(0, 102, 204, 0.02);
}

.mpp-batch-header-left {
  flex: 1;
  min-width: 0;
}

.mpp-batch-title {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.mpp-batch-summary {
  margin: 0;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mpp-batch-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.mpp-btn-icon {
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mpp-btn-icon:hover {
  background: #f5f5f5;
  border-color: #999;
}

.mpp-btn-expand {
  font-size: 12px;
  color: #666;
}

.mpp-btn-expand:hover {
  background: #e3f2fd;
  border-color: #0066cc;
  color: #0066cc;
}

.mpp-btn-edit:hover {
  background: #e3f2fd;
  border-color: #0066cc;
}

.mpp-btn-delete:hover {
  background: #ffebee;
  border-color: #d32f2f;
}

/* ========================================
   DATOS DE HORNADA (EXPANDIBLE)
   ======================================== */

.mpp-batch-data {
  padding: 0 16px 16px 16px;
  border-top: 1px solid #f0f0f0;
}

.mpp-batch-section {
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
}

.mpp-batch-section:last-child {
  border-bottom: none;
}

.mpp-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #0066cc;
  margin: 0 0 12px 0;
}

/* ========================================
   TABLAS DE DATOS (LAYOUT LIMPIO)
   ======================================== */

.mpp-data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.mpp-data-table th {
  padding: 4px 8px 2px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mpp-data-table td {
  padding: 6px 8px 16px 8px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
}

.mpp-note {
  background: #f9f9f9;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 3px solid #0066cc;
  font-style: italic;
  margin: 8px 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

/* ========================================
   MODAL
   ======================================== */

.mpp-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.mpp-modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.mpp-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 2px solid #e0e0e0;
  background: #fafafa;
}

.mpp-modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
}

.mpp-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.mpp-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* ========================================
   FORMULARIO
   ======================================== */

.mpp-batch-form {
  padding: 24px;
}

/* Sistema de grid de 3 columnas - FIJO (sin responsive) */
.mpp-batch-form .mpp-form-row-3 {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 16px !important;
  margin-bottom: 16px !important;
}

/* Utilidades para spanning */
.mpp-batch-form .mpp-col-span-2 {
  grid-column: span 2 !important;
}

.mpp-batch-form .mpp-col-span-3 {
  grid-column: span 3 !important;
}

.mpp-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  min-width: 0;
}

.mpp-form-field label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mpp-form-field input,
.mpp-form-field select,
.mpp-form-field textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  box-sizing: border-box;
  width: 100%;
  background: white;
}

.mpp-form-field input:focus,
.mpp-form-field select:focus,
.mpp-form-field textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  background: white;
}

.mpp-form-field textarea {
  resize: vertical;
  min-height: 50px;
}

/* ========================================
   FIELDSET
   ======================================== */

.mpp-fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  background: #fafafa;
}

.mpp-fieldset legend {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  padding: 0 12px;
  background: white;
}

.mpp-fieldset .mpp-form-field {
  margin-bottom: 12px;
}

.mpp-fieldset .mpp-form-field:last-child {
  margin-bottom: 0;
}

/* ========================================
   BOTONES
   ======================================== */

.mpp-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.mpp-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.mpp-btn-primary {
  background: #0066cc;
  color: white;
}

.mpp-btn-primary:hover {
  background: #0052a3;
}

.mpp-btn-secondary {
  background: #f5f5f5;
  color: #333;
}

.mpp-btn-secondary:hover {
  background: #e0e0e0;
}

.mpp-btn:active {
  transform: scale(0.98);
}

/* ========================================
   MENSAJES
   ======================================== */

.mpp-notice {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mpp-notice-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.mpp-notice-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.mpp-notice-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ========================================
   FIN DEL CSS
   ======================================== */
