/* ===== Tools Page ===== */

/* Action bar sits directly below fixed navbar (no sub-nav on this page) */
.tools-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 82px 40px 10px;
  background: #f2f3f5;
}

.tools-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tools-caption-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.tools-caption-desc {
  font-size: 0.78rem;
  color: #6b7280;
}

.tools-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Save & Predict button — override circular icon style from optimize.css */
.tools-action-bar #optimize-and-save {
  width: auto;
  height: auto;
  border-radius: 6px;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #4caf50;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}

/* Remove any pseudo-element content from optimize.css */
.tools-action-bar #optimize-and-save::before {
  content: none;
}

.tools-action-bar #optimize-and-save:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 3px 6px rgba(0,0,0,.12);
}

.tools-action-bar #optimize-and-save:disabled {
  background: #9e9e9e;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Push buttons */
#push-selected-button,
#push-all-button {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}

#push-selected-button            { background: #2196F3; }
#push-selected-button:disabled   { background: #9e9e9e; cursor: not-allowed; opacity: 0.6; }
#push-all-button                 { background: #e53935; }

#push-selected-button:hover:not(:disabled),
#push-all-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 3px 6px rgba(0,0,0,.12);
}

#push-status {
  font-size: 0.85rem;
  color: #555;
}

/* ===== Layout ===== */

/* Flex-column wrapper holds the top 2-col section + bottom full-width table */
.tools-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 124px);
  gap: 0;
  padding: 16px 40px 24px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Top 2-column section — takes 58% of available height */
.tools-wrapper .tools-layout {
  flex: 0 0 58%;
  height: auto;
  padding: 0;
  min-height: 0;
  overflow: hidden;
}

/* Bottom full-width recommendations */
.tools-bottom {
  flex: 1;
  min-height: 0;
  padding-top: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tools-bottom .tools-recs-card {
  flex: 1;
  min-height: 0;
}

/* Uniform card header size */
.tools-wrapper .card-header h2 {
  font-size: .95rem;
  font-weight: 700;
}

/* Graph fills the full left panel */
.tools-graph-card {
  flex: 1;
}

.tools-graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.graph-day-controls {
  display: flex;
  gap: 4px;
}

.day-btn {
  padding: 3px 9px;
  border: 1px solid #dcdfe3;
  border-radius: 4px;
  background: #fff;
  font-size: 0.78rem;
  cursor: pointer;
  color: #374151;
  transition: background 0.1s, color 0.1s;
}

.day-btn:hover {
  background: #f3f4f6;
}

.day-btn.active {
  background: #2196F3;
  color: #fff;
  border-color: #2196F3;
}

/* Impact cards in right panel */
.tools-layout .impact-card {
  flex: 1;
  min-height: 0;
}

.tools-layout .impact-card .card-body {
  overflow-y: auto;
}

.tools-layout .impact-card .recommendations-table tbody tr {
  height: auto;
}

/* ===== Item Recommendations controls ===== */

.tools-recs-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tools-recs-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.recs-search-input {
  border: 1px solid #dcdfe3;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  outline: none;
  width: 180px;
  color: #374151;
}

.recs-search-input:focus {
  border-color: #2196F3;
}

.recs-sort-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.recs-sort-label {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 600;
}

.recs-sort-btn {
  padding: 3px 10px;
  border: 1px solid #dcdfe3;
  border-radius: 4px;
  background: #fff;
  font-size: 0.78rem;
  cursor: pointer;
  color: #374151;
  transition: background 0.1s, color 0.1s;
}

.recs-sort-btn:hover {
  background: #f3f4f6;
}

.recs-sort-btn.active {
  background: #2196F3;
  color: #fff;
  border-color: #2196F3;
}

.price-edit-icon {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-left: 5px;
  cursor: default;
  user-select: none;
  flex-shrink: 0;
  transition: color 0.15s;
}

.price-edit-icon--dirty {
  color: #f59e0b;
}

.ci-band {
  display: block;
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 2px;
}

/* ===== Responsive ===== */

@media (max-width: 960px) {
  .tools-wrapper {
    height: auto;
    overflow: visible;
  }

  .tools-wrapper .tools-layout {
    flex: none;
    height: auto;
  }

  .tools-bottom {
    flex: none;
    height: 320px;
  }

  .tools-action-bar {
    padding-top: 82px;
  }
}
