/* Sales workspace: compact, operational layout mounted by admin-crm.js. */
.sales-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  padding: 6px;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  background: #f7faf8;
}

.sales-workspace-tabs,
.sales-workspace-view {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sales-workspace-tabs { min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.sales-workspace-view { flex: 0 0 auto; }

.sales-view-button,
.sales-page-size {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cfd9d2;
  border-radius: 6px;
  background: #fff;
  color: #34463a;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.sales-view-button { cursor: pointer; }
.sales-view-button.active { border-color: #126b3b; background: #e9f6ee; color: #0d5630; }
.sales-page-size { width: 62px; }

#crm-list.owner-request-list {
  display: block;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.sales-weekly {
  margin-bottom: 10px;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  background: #fff;
}

.sales-weekly-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px 7px;
  border-bottom: 1px solid #e8eeea;
}

.sales-weekly-head span,
.sales-weekly-head strong { display: block; }
.sales-weekly-head span { color: #9a5a05; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.sales-weekly-head strong { margin-top: 2px; color: #20382a; font-size: 13px; }
.sales-weekly-head small { color: #69776e; font-size: 10px; }

.sales-goal-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); }
.sales-goal { min-width: 0; padding: 8px 10px; border-right: 1px solid #edf1ee; }
.sales-goal:last-child { border-right: 0; }
.sales-goal > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sales-goal strong { color: #173b28; font-size: 12px; }
.sales-goal span { min-width: 0; color: #55645b; font-size: 10px; overflow-wrap: anywhere; }
.sales-goal small { display: block; margin-top: 4px; color: #7a5a20; font-size: 9px; }

.sales-goal-track { height: 5px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: #e4e9e6; }
.sales-goal-track i { display: block; height: 100%; border-radius: inherit; background: #1a7545; }

.sales-table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid #d5dfd8;
  border-radius: 8px;
  background: #fff;
}

.sales-pipeline-table { width: 100%; min-width: 1040px; border-collapse: collapse; table-layout: fixed; }
.sales-pipeline-table th {
  padding: 7px 8px;
  border-bottom: 1px solid #dce5df;
  background: #f3f6f4;
  color: #5c6961;
  font-size: 9px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}
.sales-pipeline-table th:nth-child(1) { width: 19%; }
.sales-pipeline-table th:nth-child(2) { width: 13%; }
.sales-pipeline-table th:nth-child(3) { width: 8%; }
.sales-pipeline-table th:nth-child(4) { width: 24%; }
.sales-pipeline-table th:nth-child(5) { width: 13%; }
.sales-pipeline-table th:nth-child(6) { width: 10%; }
.sales-pipeline-table th:nth-child(7) { width: 13%; }

.sales-pipeline-table td {
  height: 58px;
  padding: 6px 8px;
  border-bottom: 1px solid #edf1ee;
  color: #35443a;
  font-size: 11px;
  vertical-align: middle;
}
.sales-pipeline-table tr:last-child td { border-bottom: 0; }
.sales-pipeline-table tbody tr:hover { background: #f7fbf8; }
.sales-pipeline-row.is-overdue { box-shadow: inset 3px 0 #bd4a3c; }

.sales-account { min-width: 0; }
.sales-account strong,
.sales-account span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-account strong { color: #20382a; font-size: 12px; }
.sales-account span { margin-top: 2px; color: #6c776f; font-size: 9px; }

.sales-stage-select,
.sales-owner-select {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid #ccd7cf;
  border-radius: 6px;
  background: #fff;
  color: #35443a;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}
.sales-stage-select.tone-hot { border-color: #d9a541; background: #fff8e8; color: #714607; }
.sales-stage-select.tone-converted { border-color: #6fb38a; background: #edf8f1; color: #155b34; }
.sales-stage-select.tone-discarded { border-color: #d5a6a1; background: #fff4f2; color: #8a3027; }
.sales-stage-select.tone-warm { border-color: #87acc8; background: #f1f7fb; color: #285b7e; }

.sales-score { position: relative; }
.sales-score summary { display: inline-flex; align-items: baseline; gap: 2px; cursor: pointer; list-style: none; }
.sales-score summary::-webkit-details-marker { display: none; }
.sales-score summary strong { color: #173b28; font-size: 15px; }
.sales-score summary span { color: #77837b; font-size: 9px; }
.sales-score-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  left: 0;
  width: 300px;
  padding: 9px;
  border: 1px solid #cbd7cf;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(25, 47, 34, .16);
}
.sales-score-popover strong,
.sales-score-popover span { display: block; }
.sales-score-popover strong { margin-bottom: 5px; color: #20382a; font-size: 11px; }
.sales-score-popover span { padding: 4px 0; border-top: 1px solid #edf1ee; color: #526057; font-size: 10px; line-height: 1.35; }

.sales-next-cell { min-width: 0; }
.sales-priority-reason { display: block; margin-bottom: 3px; color: #785112; font-size: 9px; font-weight: 850; }
.sales-next-cell .crm-next-action,
.sales-board-card .crm-next-action {
  min-height: 31px;
  padding: 5px 8px;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* En el tablero las tarjetas son angostas y el botón a ancho completo va
   bien. En la tabla no: son 25 filas, y estirar la píldora a 369 px de una
   celda de 385 llenaba la columna de barras saturadas. Mismo color, que
   codifica el canal, con una fracción de la tinta. */
.sales-board-card .crm-next-action { width: 100%; }
.sales-next-cell .crm-next-action { width: auto; max-width: 100%; }
.sales-due { color: #657169; font-size: 10px; }
.sales-due.is-overdue { color: #a0372c; font-weight: 900; }
.sales-value { color: #244c34; font-weight: 850; white-space: nowrap; }

.sales-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(190px, 1fr));
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 5px;
}
.sales-board-column { min-width: 190px; border: 1px solid #d8e1db; border-radius: 8px; background: #f5f7f5; }
.sales-board-column > header { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border-bottom: 1px solid #dfe6e1; }
.sales-board-column > header strong { color: #34473a; font-size: 10px; text-transform: uppercase; }
.sales-board-column > header span { min-width: 20px; padding: 2px 5px; border-radius: 8px; background: #dfe9e2; color: #365443; font-size: 9px; text-align: center; }
.sales-board-column > div { display: grid; gap: 6px; padding: 6px; }
.sales-board-column > div > p { margin: 4px; color: #7b857e; font-size: 10px; }
.sales-board-card { display: grid; gap: 7px; padding: 8px; border: 1px solid #d9e1dc; border-radius: 7px; background: #fff; }
.sales-board-card > div:first-child { display: flex; align-items: start; justify-content: space-between; gap: 6px; }
.sales-board-card > div:first-child > strong { color: #20382a; font-size: 11px; line-height: 1.3; }
.sales-board-card .sales-score-popover { left: auto; right: 0; }

.sales-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px 0; }
.sales-pagination > span { color: #68746c; font-size: 10px; }
.sales-pagination > div { display: flex; gap: 5px; }

.revenue-command__weekly {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  border-bottom: 1px solid #e4ece7;
  background: #fff;
}
.revenue-command__weekly > div { padding: 9px 11px; border-right: 1px solid #edf1ee; }
.revenue-command__weekly > div:last-child { border-right: 0; }
.revenue-command__weekly span,
.revenue-command__weekly strong,
.revenue-command__weekly small { display: block; }
.revenue-command__weekly span { color: #657269; font-size: 9px; text-transform: uppercase; }
.revenue-command__weekly strong { margin-top: 2px; color: #213d2b; font-size: 12px; }
.revenue-command__weekly i { display: block; height: 4px; margin-top: 5px; overflow: hidden; border-radius: 2px; background: #e4e9e6; }
.revenue-command__weekly b { display: block; height: 100%; background: #1a7545; }
.revenue-command__weekly small { margin-top: 3px; color: #8a6018; font-size: 8px; }

@media (max-width: 900px) {
  .sales-workspace-toolbar { align-items: stretch; flex-direction: column; }
  .sales-workspace-view { justify-content: flex-end; }
  .sales-goal-grid { grid-template-columns: repeat(5, minmax(112px, 1fr)); overflow-x: auto; }
  .revenue-command__weekly { grid-template-columns: repeat(5, minmax(110px, 1fr)); overflow-x: auto; }
}

@media (max-width: 600px) {
  .sales-weekly-head { align-items: start; flex-direction: column; gap: 3px; }
  .sales-workspace-view { justify-content: flex-start; }
  .sales-pagination { align-items: stretch; flex-direction: column; }
  .sales-pagination > div { justify-content: flex-end; }
  .sales-score-popover { position: fixed; top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; }
}
