/* Listini da approvare (agent_offer_requests): l'elenco come la coda «Da fare oggi», la scheda come una tabella
   del Hub con i campi del prezzo nella riga. */
.aor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.aor-tab {
  min-height: 44px;
  gap: 0.5rem;
}

.aor-tab.is-active {
  border-color: var(--navy);
  background: var(--azure-soft);
  color: var(--navy);
  font-weight: 600;
}

.aor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aor-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}

.aor-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.aor-item-sub,
.aor-item-meta {
  font-size: 0.875rem;
  color: var(--gray-text);
}

.aor-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
}

.aor-status {
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.aor-status.is-approved {
  background: color-mix(in srgb, var(--semaforo-verde) 10%, var(--surface));
  color: var(--semaforo-verde);
}

.aor-status.is-returned {
  background: color-mix(in srgb, var(--semaforo-arancio) 10%, var(--surface));
  color: var(--ink);
}

.aor-empty {
  padding: 2rem;
  text-align: center;
  color: var(--gray-text);
}

.aor-decision {
  margin-top: 0.5rem;
  font-weight: 600;
}

.aor-decision.is-approved {
  color: var(--semaforo-verde);
}

.aor-decision.is-returned {
  color: var(--ink);
}

.aor-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.aor-table th,
.aor-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.aor-table th.is-num,
.aor-table td.is-num {
  text-align: right;
  white-space: nowrap;
}

.aor-table tr.is-civetta td:first-child {
  border-left: 3px solid var(--corallo);
}

.aor-table tr.is-error td {
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}

.aor-code,
.aor-reason,
.aor-floor {
  display: block;
  font-size: 0.8125rem;
  color: var(--gray-text);
}

.aor-error {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--danger);
}

.aor-input {
  min-height: 44px;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  font: inherit;
  font-size: 1rem;
  max-width: 100%;
  color: var(--ink);
  background: var(--surface);
}

.aor-input.is-price {
  width: 6rem;
  text-align: right;
}

.aor-decide {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.aor-note {
  display: flex;
  flex: 1 1 20rem;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
}

.aor-note textarea {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  font: inherit;
  font-weight: 400;
}

.aor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.aor-item:hover {
  border-color: var(--navy);
  background: var(--azure-soft);
}

.aor-remove {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  cursor: pointer;
}

.aor-remove input {
  width: 20px;
  height: 20px;
  accent-color: var(--navy);
}

.aor-table tr:has(.aor-remove input:checked) {
  opacity: 0.65;
}

.aor-table tr:has(.aor-remove input:checked) td:first-child strong {
  text-decoration: line-through;
}

@media (max-width: 900px) {
  .aor-page .aor-table,
  .aor-page .aor-table tbody {
    display: block;
  }

  .aor-page .aor-table thead {
    display: none;
  }

  .aor-page .aor-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
  }

  .aor-page .aor-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: auto;
    min-width: 0;
    padding: 0.5rem;
    border-bottom: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .aor-page .aor-table td:first-child {
    grid-column: 1 / -1;
  }

  .aor-page .aor-table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-text);
  }

  .aor-page .aor-table td.is-num::before {
    position: static;
    width: auto;
  }

  .aor-actions {
    width: 100%;
  }

  .aor-actions .btn-primary,
  .aor-actions .btn-secondary {
    flex: 1 1 12rem;
    min-height: 44px;
    white-space: normal;
    text-align: center;
  }
}
