/* Agency "Orders list" page (Havas orders_list template) — the logged-in
   agency's own orders table with search, pagination and a resend-email action.
   Brand-token driven so it matches the storefront skin; no admin.css here. */

.agency-orders .container {
  max-width: var(--container-xxl);
}

/* Search bar */
.ao-search {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.ao-search input[type="search"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 10px 14px;
  font: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-btn);
}
.ao-search input[type="search"]:focus-visible {
  outline: 2px solid var(--color-action);
  outline-offset: 1px;
}

/* Buttons */
.ao-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: var(--text-btn);
  font-weight: 600;
  line-height: 1;
  color: var(--color-on-band);
  background: var(--color-action);
  border: 1px solid var(--color-action);
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.ao-btn:hover {
  background: var(--color-action-hover);
  border-color: var(--color-action-hover);
}
.ao-btn:disabled,
.ao-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.ao-btn--sm {
  padding: 7px 12px;
  font-size: var(--text-xs);
}
.ao-btn--ghost {
  color: var(--color-action);
  background: transparent;
}
.ao-btn--ghost:hover {
  color: var(--color-on-band);
}

/* Table */
.ao-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.ao-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  color: var(--color-text);
}
.ao-table thead th {
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
/* Numeric columns: header AND cells right-aligned together (the header rule above
   forces left, so re-assert right on the numeric header). */
.ao-table thead th.ao-num {
  text-align: right;
}
.ao-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.ao-table tbody tr:last-child td {
  border-bottom: 0;
}
.ao-table tbody tr:hover {
  background: var(--color-bg-alt);
}
.ao-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ao-ref {
  font-weight: 600;
  color: var(--color-primary);
}
.ao-actions-col {
  white-space: nowrap;
}
.ao-perf {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-soft);
}
.ao-empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--color-text-soft);
}

/* Status chip */
.ao-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.ao-chip--green {
  color: #1c7a34;
  background: #e3f6e8;
}
.ao-chip--amber {
  color: #97590a;
  background: #fdefd8;
}
.ao-chip--red {
  color: #b21e3e;
  background: #fde3ea;
}
.ao-chip--orange {
  color: #c2410c;
  background: #ffe8d4;
}
.ao-chip--blue {
  color: #0a6e81;
  background: #dcf0f4;
}
.ao-chip--gray {
  color: var(--color-text-soft);
  background: var(--color-bg-alt);
}

/* Per-row actions: icon-only buttons + a floating feedback toast */
.ao-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ao-actform {
  display: inline-flex;
  margin: 0;
}
.ao-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--color-action);
  background: transparent;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ao-iconbtn:hover {
  color: var(--color-on-band);
  background: var(--color-action);
  border-color: var(--color-action);
}
.ao-iconbtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ao-iconbtn--danger {
  color: var(--color-danger);
  border-color: #f3c6d0;
}
.ao-iconbtn--danger:hover {
  color: #fff;
  background: var(--color-danger);
  border-color: var(--color-danger);
}
.ao-iconbtn--undo {
  color: var(--color-warning);
  border-color: #f6ddba;
}
.ao-iconbtn--undo:hover {
  color: #fff;
  background: var(--color-warning);
  border-color: var(--color-warning);
}
.ao-iconbtn--ghost {
  color: var(--color-text-soft);
}

.ao-spin {
  animation: ao-spin 0.7s linear infinite;
}
@keyframes ao-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Feedback toast — absolutely positioned to the LEFT of the action buttons so it
   never widens the cell or reflows the row; auto-fades. */
.ao-msg {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: var(--text-xs);
  font-weight: 600;
  pointer-events: none;
  animation: ao-msg-fade 4s ease forwards;
}
.ao-msg.is-ok {
  color: var(--color-sale);
}
.ao-msg.is-err {
  color: var(--color-danger);
}
@keyframes ao-msg-fade {
  0%,
  65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ao-msg {
    animation: none;
  }
}

/* Pagination */
.ao-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}
.ao-pager__at {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
}
