
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 30fr 30fr 40fr;
  gap: 16px;
  min-width: 0;
  align-items: stretch;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  min-width: 0;
}

.panel-title-row h3 {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.btn-link {
  min-height: 28px;
  border: none;
  background: transparent;
  color: var(--primary);
  padding: 0 0.5rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.78rem;
  white-space: nowrap;
}

.btn-link:hover {
  border: none;
  background: rgba(var(--primary-rgb), 0.12);
  text-decoration: none;
}

#dashboard-attention-all {
  min-width: 72px;
  min-height: 30px;
  padding: 0 0.58rem;
  text-align: center;
}

.dashboard-attention-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
  min-height: 0;
  height: 100%;
}

.dashboard-attention-donut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  text-align: center;
}

.dashboard-attention-donut-ring {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
}

.dashboard-attention-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  padding: 0 0.5rem;
}

.dashboard-attention-donut-num {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
}

.dashboard-attention-donut-label {
  font-size: 0.52rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
}

.dashboard-attention-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  margin-top: 0.2rem;
}

.dashboard-attention-donut-legend span {
  font-size: 0.6rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.22rem;
}

.dashboard-donut-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  display: inline-block;
  flex: none;
}

.dashboard-attention-list,
.dashboard-goals-list,
.dashboard-agenda-list {
  display: grid;
  gap: 0.24rem;
  align-content: start;
  min-width: 0;
}

.dashboard-attention-list {
  gap: 0.5rem;
}

/* Productos a la venta: apagar un producto lo saca de lo que el agente ofrece. */
.dashboard-catalog-list {
  display: grid;
  gap: 0.1rem;
  align-content: start;
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.dashboard-catalog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.42rem 0.1rem;
  border-bottom: 1px solid rgba(var(--border-rgb), 0.5);
  min-width: 0;
}

.dashboard-catalog-item:last-child {
  border-bottom: none;
}

.dashboard-catalog-name {
  font-size: 0.86rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-catalog-item.is-off .dashboard-catalog-name {
  color: var(--muted);
  font-weight: 500;
}

.dashboard-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  cursor: pointer;
}

.dashboard-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.dashboard-switch input:disabled {
  cursor: progress;
}

.dashboard-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  transition: background 160ms ease, border-color 160ms ease;
  pointer-events: none;
}

.dashboard-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
  pointer-events: none;
}

.dashboard-switch input:checked ~ .dashboard-switch-track {
  background: var(--primary);
  border-color: var(--primary);
}

.dashboard-switch input:checked ~ .dashboard-switch-knob {
  transform: translateX(16px);
  background: #ffffff;
}

.dashboard-switch input:focus-visible ~ .dashboard-switch-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.panel.dashboard-attention-panel,
.panel.dashboard-goals-panel,
.panel.dashboard-catalog-panel,
.panel.dashboard-metas-panel,
.panel.dashboard-origin-panel {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.2rem;
  padding: 0.46rem;
}

.panel.dashboard-calendar-panel {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.2rem;
  padding: 0.46rem;
}

#dashboard-calendar-subtitle {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.3;
}

#dashboard-agenda-date.hint {
  margin: 0;
  font-size: 0.79rem;
}

.dashboard-attention-list,
.dashboard-goals-list,
.dashboard-agenda-list {
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.dashboard-attention-item,
.dashboard-goal-item,
.dashboard-agenda-item,
.dashboard-slot-item {
  border: 1px solid rgba(var(--border-rgb), 0.75);
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.45);
  padding: 0.24rem 0.36rem;
}

.dashboard-attention-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.85rem 0.9rem;
}

.dashboard-attention-info {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-attention-item > strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.dashboard-attention-item > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 0.28rem;
  min-width: 0;
}

.dashboard-attention-item strong {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.02rem;
  font-weight: 700;
}

.dashboard-attention-item p {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-attention-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
  flex: none;
}

.dashboard-attention-actors {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.dashboard-mode-pill {
  min-height: 24px;
  min-width: 24px;
  padding: 0 0.34rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: 1px solid rgba(var(--border-rgb), 0.35);
  font-size: 0.74rem;
  line-height: 1;
}

.dashboard-mode-pill strong {
  font-size: 0.64rem;
}

.dashboard-mode-pill-icon {
  width: 24px;
  padding: 0;
}

.dashboard-mode-pill-human {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.42);
}

.dashboard-mode-pill-ai {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
}

.dashboard-attention-meta small {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.dashboard-attention-item .btn {
  min-height: 34px;
  padding: 0 0.85rem;
  font-size: 0.9rem;
  border-radius: 8px;
}

.dashboard-goals-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-period-wrap {
  display: grid;
  gap: 0.2rem;
}

.dashboard-period-control {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.dashboard-period-control select,
.dashboard-period-control input {
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(var(--border-rgb), 0.35);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0 0.45rem;
  font-size: 0.72rem;
}

.dashboard-chart {
  display: grid;
  gap: 0.32rem;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
}

.trend-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
}

.trend-row .label {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trend-row .bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid rgba(var(--border-rgb), 0.22);
  position: relative;
}

.trend-row .fill {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-warm));
}

.trend-row.orders .fill {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.92), rgba(251, 191, 36, 0.95));
}

.trend-row .value {
  color: var(--text);
  font-weight: 600;
}

.dashboard-goal-item {
  display: grid;
  align-content: center;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.22rem 0.34rem;
}

.dashboard-goal-item .goal-top {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0;
  gap: 0.5rem;
  min-width: 0;
}

.dashboard-goal-item .goal-top strong {
  font-size: 0.9rem;
  white-space: nowrap;
}

.dashboard-goal-item .goal-bar {
  height: 4px;
}

.dashboard-goal-item > small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.dashboard-goal-item .hint {
  font-size: 0.66rem;
  line-height: 1.3;
  margin: 0;
}

.dashboard-metas-list {
  display: grid;
  gap: 0.42rem;
  align-content: start;
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.dashboard-meta-item {
  border: 1px solid rgba(var(--border-rgb), 0.75);
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.45);
  padding: 0.4rem 0.55rem;
  min-width: 0;
}

.dashboard-meta-item .goal-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  margin-bottom: 0.3rem;
}

.dashboard-meta-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.dashboard-meta-item strong {
  flex: none;
  font-size: 0.85rem;
}

.dashboard-origin-list {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.dashboard-origin-item {
  border: 1px solid rgba(var(--border-rgb), 0.75);
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.45);
  padding: 0.42rem 0.55rem;
  min-width: 0;
}

.dashboard-origin-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.32rem;
  min-width: 0;
}

.dashboard-origin-icon {
  font-size: 0.95rem;
  flex: none;
}

.dashboard-origin-name {
  font-weight: 600;
  font-size: 0.82rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-origin-clients {
  flex: none;
  color: var(--muted);
  font-size: 0.75rem;
}

.dashboard-origin-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-origin-footnote {
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

/* "Sin identificar": mismo formato que las demas tarjetas de origen, pero con
   borde punteado y relleno degradado propio para que se distinga de un vistazo
   que no es una red social real, sin dejar de verse parte del mismo grupo. */
.dashboard-origin-item--unknown {
  border-style: dashed;
  border-color: rgba(var(--border-rgb), 1);
  background: rgba(var(--border-rgb), 0.18);
}

.dashboard-origin-item--unknown .dashboard-origin-icon {
  filter: grayscale(1);
  opacity: 0.85;
}

.dashboard-origin-item--unknown .goal-bar div {
  background: repeating-linear-gradient(
    135deg,
    var(--muted),
    var(--muted) 6px,
    rgba(var(--border-rgb), 0.5) 6px,
    rgba(var(--border-rgb), 0.5) 12px
  );
}

.dashboard-origin-empty {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.35rem;
  text-align: center;
  padding: 1.6rem 0.6rem 0.6rem;
  color: var(--muted);
}

.dashboard-origin-empty-icon {
  font-size: 1.6rem;
  opacity: 0.75;
}

.dashboard-origin-empty p {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}

.dashboard-origin-empty small {
  font-size: 0.75rem;
  max-width: 34ch;
  line-height: 1.35;
}

.dashboard-origin-period {
  display: inline-flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.dashboard-origin-period .btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.panel.dashboard-calendar-panel .panel-title-row {
  flex-wrap: wrap;
}

.dashboard-calendar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  width: 100%;
}

.dashboard-calendar-actions .btn {
  min-height: 28px;
  padding: 0 0.45rem;
  font-size: 0.7rem;
  border-radius: 8px;
}

#dashboard-cal-title {
  font-size: 0.92rem;
  white-space: nowrap;
}

.dashboard-calendar-grid {
  min-height: 0;
  min-width: 0;
  display: grid;
}

.dashboard-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto repeat(6, minmax(0, 1fr));
  gap: 0.22rem;
  min-width: 0;
  min-height: 0;
}

.dashboard-cal-weekday {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0.12rem 0;
}

.dashboard-cal-cell {
  border: 1px solid rgba(var(--border-rgb), 0.74);
  border-radius: 9px;
  background: rgba(var(--surface-rgb), 0.52);
  min-height: 0;
  min-width: 0;
  padding: 0.2rem 0.26rem;
  display: grid;
  align-content: start;
  gap: 0.1rem;
  text-align: left;
  cursor: pointer;
}

.dashboard-cal-cell.empty {
  opacity: 0;
  pointer-events: none;
  border-color: transparent;
  background: transparent;
}

.dashboard-cal-cell.outside {
  background: rgba(var(--surface-rgb), 0.28);
  border-color: rgba(var(--border-rgb), 0.4);
}

.dashboard-cal-cell.outside .day {
  color: var(--muted);
}

.dashboard-cal-cell .day {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text);
  line-height: 1.1;
}

.dashboard-cal-cell .meta {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-cal-cell .dots {
  display: flex;
  gap: 0.16rem;
}

.dashboard-cal-cell.today {
  border-color: rgba(var(--primary-rgb), 0.8);
  background: rgba(var(--primary-rgb), 0.16);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.4);
}

.dashboard-cal-cell.today .day {
  color: var(--primary);
}

.dashboard-cal-cell.selected {
  outline: 2px solid rgba(var(--primary-rgb), 0.9);
  outline-offset: -2px;
  border-color: rgba(var(--primary-rgb), 0.95);
  background: rgba(var(--primary-rgb), 0.22);
}

.dashboard-cal-cell.selected .day {
  color: var(--primary);
}

.dashboard-cal-cell.today.selected {
  background: rgba(var(--primary-rgb), 0.3);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.dot-confirmed { background: var(--ok); }
.dot-pending { background: var(--warn); }
.dot-paid { background: var(--primary); }
.dot-problem { background: var(--danger); }

.dashboard-calendar-legend {
  margin-top: 0.12rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
  min-width: 0;
}

.dashboard-agenda-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 0.28rem;
  align-items: center;
  min-width: 0;
}

.dashboard-agenda-hour {
  font-weight: 700;
  color: var(--text);
  font-size: 0.84rem;
}

.dashboard-agenda-main {
  min-width: 0;
}

.dashboard-agenda-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-agenda-main p {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-agenda-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.dashboard-agenda-state .btn {
  min-height: 26px;
  padding: 0 0.55rem;
  font-size: 0.7rem;
  border-radius: 8px;
}

.dashboard-days-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dashboard-days-wrap .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.dashboard-slot-list {
  display: grid;
  gap: 0.35rem;
  max-height: 220px;
  overflow: auto;
}

.dashboard-slot-item {
  display: grid;
  grid-template-columns: 110px auto minmax(90px, 100px) minmax(140px, 1fr) auto auto auto auto;
  gap: 0.35rem;
  align-items: center;
}

/* ---------------------------------------------------------------------------
   Rescate de clientes: quien pregunto y se quedo callado.
   Vive junto a "Atencion inmediata" porque responde la misma pregunta -- a quien
   le falta algo -- pero de gente distinta: uno espera respuesta, el otro se enfrio.
   --------------------------------------------------------------------------- */
.dashboard-recovery-panel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 0;
}

.dashboard-recovery-nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  flex-shrink: 0;
}

.dashboard-recovery-num {
  background: var(--bg-soft);
  border-radius: 9px;
  padding: 0.5rem 0.55rem;
  min-width: 0;
}

.dashboard-recovery-num span {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
  line-height: 1.25;
  margin-bottom: 0.1rem;
}

.dashboard-recovery-num strong {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.dashboard-recovery-num.win strong { color: var(--ok); }

.dashboard-recovery-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.dashboard-recovery-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(var(--border-rgb), 0.5);
}

.dashboard-recovery-item:last-child { border-bottom: none; }

.dashboard-recovery-who { min-width: 0; }

.dashboard-recovery-who strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-recovery-who small {
  font-size: 0.68rem;
  color: var(--muted);
}

.dashboard-recovery-when {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 178, 77, 0.14);
  color: var(--warn);
  white-space: nowrap;
  flex-shrink: 0;
}

.dashboard-recovery-foot {
  flex-shrink: 0;
  margin: 0;
}

/* Five-column order overview; full fields remain in the detail drawer. */
#reservations-table { width:100%; min-width:0; table-layout:fixed; }
#reservations-table th, #reservations-table td { white-space:normal; overflow-wrap:anywhere; padding:12px 10px; }
#reservations-table th:nth-child(1) { width:25%; }
#reservations-table th:nth-child(2) { width:30%; }
#reservations-table .reservations-select-col { width:40px; }
#reservations-table .btn { white-space:normal; }
