/* style.css — Puromenu Obrador */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f5f5f5; color: #1a1a1a; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 160px; background: #1e293b; color: #fff; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-logo { padding: 16px 14px 14px; border-bottom: 1px solid #334155; }
.sidebar-logo h2 { font-size: 14px; font-weight: 700; letter-spacing: 0.5px; }
.sidebar-logo span { font-size: 10px; color: #94a3b8; display: block; margin-top: 3px; }
.sidebar-nav { flex: 1; padding: 8px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; color: #cbd5e1; text-decoration: none;
  font-size: 13px; transition: background 0.15s;
}
.sidebar-nav a:hover { background: #334155; color: #fff; }
.sidebar-nav a.active { background: #2563eb; color: #fff; }
.sidebar-nav a .icon { font-size: 14px; width: 18px; text-align: center; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 48px; background: #fff; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; flex-shrink: 0;
}
.topbar h1 { font-size: 15px; font-weight: 600; }
.lang-toggle { display: flex; background: #f1f5f9; border-radius: 6px; overflow: hidden; border: 1px solid #e2e8f0; }
.lang-toggle button { padding: 4px 10px; border: none; background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; color: #64748b; }
.lang-toggle button.active { background: #2563eb; color: #fff; }

.content { flex: 1; padding: 20px; overflow: auto; }

/* Login */
.login-overlay { position: fixed; inset: 0; background: #1e293b; display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 340px; text-align: center; }
.login-box h2 { font-size: 20px; margin-bottom: 4px; }
.login-box p { font-size: 13px; color: #64748b; margin-bottom: 20px; }
.login-box input { width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.login-box button { width: 100%; padding: 10px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-box button:hover { background: #1d4ed8; }
.login-hidden { display: none; }
.login-error { color: #dc2626; font-size: 13px; margin-bottom: 8px; display: none; }

/* Pages */
.page { display: none; }
.page.active { display: block; }

/* Config */
.config-section { margin-bottom: 24px; }
.config-section h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: #64748b; letter-spacing: 0.5px; margin-bottom: 8px;
  padding-bottom: 5px; border-bottom: 2px solid #e2e8f0;
}
.config-table { width: 100%; border-collapse: collapse; }
.config-table th {
  text-align: left; padding: 8px 12px; font-size: 11px;
  font-weight: 600; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.3px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.config-table td { padding: 4px 8px; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.config-table td:first-child { font-weight: 500; }
.config-table input {
  width: 80px; padding: 4px 6px; border: 1px solid #d1d5db;
  border-radius: 5px; font-size: 12px; text-align: right;
}
.config-table input.comment-input {
  width: 100%; text-align: left; min-width: 140px; color: #64748b; font-style: italic;
}
.config-table select {
  padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 5px;
  font-size: 12px; min-width: 50px;
}
.config-table .ratio-cell { font-weight: 700; color: #2563eb; font-size: 13px; }

.btn-save {
  margin-top: 16px; padding: 9px 24px; background: #2563eb; color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-save:hover { background: #1d4ed8; }
.save-feedback {
  display: inline-block; margin-left: 10px; color: #16a34a;
  font-weight: 600; font-size: 13px; opacity: 0; transition: opacity 0.3s;
}
.save-feedback.show { opacity: 1; }

/* Limits */
.limits-section { margin-top: 32px; margin-bottom: 24px; }
.limits-section h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: #dc2626; letter-spacing: 0.5px; margin-bottom: 8px;
  padding-bottom: 5px; border-bottom: 2px solid #fecaca;
}
.limits-table { width: 100%; border-collapse: collapse; }
.limits-table th {
  text-align: left; padding: 8px 12px; font-size: 11px;
  font-weight: 600; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.3px; background: #fef2f2; border-bottom: 1px solid #fecaca;
}
.limits-table td { padding: 6px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.limits-table td:first-child { font-weight: 500; }
.limits-table input {
  width: 90px; padding: 5px 8px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 13px; text-align: right;
}
.limits-table select {
  padding: 5px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px;
}
.limit-na { color: #94a3b8; font-size: 12px; }

/* Planning: week selector */
.week-selector { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.week-selector button {
  padding: 5px 12px; background: #fff; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 18px; cursor: pointer; line-height: 1;
}
.week-selector button:hover { background: #f1f5f9; }
.week-selector span { font-size: 14px; font-weight: 600; min-width: 280px; text-align: center; }

/* Summary grid */
.summary-grid {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 0;
}
.summary-grid th {
  padding: 8px 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
  background: #1e293b; color: #fff; text-align: center;
}
.summary-grid th.col-station { text-align: left; width: 150px; min-width: 150px; }
.summary-grid th.day-col { cursor: pointer; min-width: 110px; transition: background 0.15s; }
.summary-grid th.day-col:hover { background: #334155; }
.summary-grid th.day-col.selected { background: #2563eb; }
.summary-grid th .day-name { display: block; font-size: 12px; }
.summary-grid th .day-date { display: block; font-size: 9px; font-weight: 400; color: #94a3b8; margin-top: 1px; }
.summary-grid th.day-col.selected .day-date { color: #bfdbfe; }

.summary-grid td {
  padding: 5px 6px; border: 1px solid #e2e8f0;
  text-align: center; vertical-align: middle; font-size: 12px;
}
.summary-grid .station-cell {
  text-align: left; padding: 6px 10px; font-weight: 600;
  font-size: 11px; background: #f8fafc; color: #334155;
  text-transform: uppercase; letter-spacing: 0.2px;
}
.summary-grid .cell-kg { color: #475569; font-weight: 500; }
.summary-grid .cell-pers { color: #2563eb; font-weight: 700; font-size: 13px; }
.summary-grid .cell-alert { background: #fef2f2; }
.summary-grid .cell-alert .cell-kg { color: #dc2626; }
.summary-grid .cell-alert .cell-pers { color: #2563eb; }
.alert-badge {
  display: inline-block; background: #dc2626; color: #fff;
  font-size: 8px; font-weight: 700; padding: 1px 4px;
  border-radius: 3px; margin-left: 2px; vertical-align: middle;
}
.summary-grid .bandeja-info { font-size: 9px; color: #64748b; display: block; }
.summary-grid .bandeja-info.over { color: #dc2626; font-weight: 600; }

.summary-grid tr.total-row td {
  background: #1e293b; color: #fff; font-weight: 700;
  font-size: 14px; padding: 8px 6px; border-color: #334155;
}
.summary-grid tr.total-row .station-cell { background: #1e293b; color: #fff; }

/* Day detail panel */
.day-detail {
  background: #fff; border: 2px solid #2563eb; border-top: none;
  border-radius: 0 0 8px 8px; padding: 20px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.1); margin-bottom: 16px;
}
.day-detail-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid #e2e8f0;
}
.day-detail-header h2 { font-size: 16px; font-weight: 700; color: #1e293b; }
.day-detail-header .detail-total { font-size: 15px; font-weight: 700; color: #2563eb; }

.detail-stations {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 14px;
}
.detail-station { border: 1px solid #e2e8f0; border-radius: 8px; overflow-x: auto; overflow-y: visible; }
.detail-station-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: #f1f5f9;
}
.detail-station-header .ds-name { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #334155; }
.detail-station-header .ds-totals { display: flex; gap: 10px; font-size: 12px; font-weight: 600; }
.detail-station-header .ds-kg { color: #475569; }
.detail-station-header .ds-pers { color: #2563eb; }
.detail-station-header.alert-hard { background: #fef2f2; }
.detail-station-header.alert-hard .ds-name { color: #dc2626; }
.detail-station-header.alert-hard .ds-kg { color: #dc2626; }
.detail-station-header.alert-hard .ds-pers { color: #2563eb; }

.detail-product-table { width: 100%; border-collapse: collapse; }
.detail-product-table th {
  text-align: left; padding: 5px 10px; font-size: 9px;
  font-weight: 600; color: #94a3b8; text-transform: uppercase;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.detail-product-table td { padding: 6px 10px; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.detail-product-table select {
  padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 4px;
  font-size: 11px; background: #fff; min-width: 100px; max-width: 140px;
}
.detail-product-table input.desc-input {
  padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 4px;
  font-size: 12px; width: 100%; min-width: 126px;
}
.detail-product-table input.secondary-input {
  width: 60px; padding: 4px 6px; border: 1px solid #d1d5db;
  border-radius: 4px; text-align: right; font-size: 12px; color: #94a3b8;
}
.detail-product-table input.secondary-input.active-input { color: #1a1a1a; }
.detail-product-table .unit-label {
  font-size: 9px; color: #94a3b8; white-space: nowrap;
}
.detail-product-table input.kg-input {
  width: 70px; padding: 4px 6px; border: 1px solid #d1d5db;
  border-radius: 4px; text-align: right; font-size: 12px;
}
.detail-product-table .pers-val { font-weight: 700; color: #2563eb; font-size: 13px; text-align: center; }
.detail-product-table .add-row {
  padding: 5px 10px; color: #2563eb; font-size: 11px;
  cursor: pointer; border: none; background: transparent; width: 100%; text-align: left;
}
.detail-product-table .add-row:hover { background: #eff6ff; }
.detail-product-table .del-btn {
  color: #dc2626; cursor: pointer; border: 1px solid #fecaca; background: #fef2f2;
  font-size: 12px; padding: 2px 6px; border-radius: 4px; font-weight: 700;
  line-height: 1;
}
.detail-product-table .del-btn:hover { background: #dc2626; color: #fff; }

.bandeja-bar {
  padding: 3px 10px; font-size: 10px; color: #64748b;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.bandeja-bar.over { background: #fef2f2; color: #dc2626; font-weight: 600; }

.manual-input-row { padding: 10px; display: flex; align-items: center; gap: 8px; }
.manual-input-row label { font-size: 12px; color: #64748b; }
.manual-input-row input {
  width: 55px; padding: 4px 6px; border: 1px solid #d1d5db;
  border-radius: 4px; text-align: center; font-size: 13px;
}

/* Export */
.export-bar { margin-top: 16px; display: flex; gap: 8px; }
.export-bar button {
  padding: 8px 20px; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; border: 1px solid #d1d5db; background: #fff;
}
.export-bar button:hover { background: #f1f5f9; }
.export-bar .btn-pdf { background: #dc2626; color: #fff; border-color: #dc2626; }
.export-bar .btn-pdf:hover { background: #b91c1c; }
.export-bar .btn-excel { background: #16a34a; color: #fff; border-color: #16a34a; }
.export-bar .btn-excel:hover { background: #15803d; }
