/* Account credential vault */

.av-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.av-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 10px;
}

.av-notice strong {
  display: block;
  margin-bottom: 0.15rem;
}

.av-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.av-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.av-status-bar--archive {
  padding: 0.35rem 0 0;
}

.av-archive-hint {
  margin: 0;
}

.av-archived-meta {
  margin: 0.35rem 0 0;
}

.av-card--archived {
  opacity: 0.92;
  border-color: color-mix(in srgb, var(--border) 80%, var(--muted));
}

.av-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.av-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.av-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.av-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.av-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.av-model-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.av-model-filter-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.av-model-filter-select {
  min-width: 9rem;
  max-width: 14rem;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

.av-model-filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.av-status-bar--archive .av-model-filter {
  margin-left: 0;
}

.av-status-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.av-status-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.25rem;
}

.av-status-tab {
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.av-status-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.av-status-tab.active {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.45);
  color: #86efac;
}

.av-status-tab[data-status="assigned"].active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.av-status-tab[data-status="banned"].active {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.av-sync {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.av-sync--no_posting,
.av-sync--posting_inactive,
.av-sync--handle_drift {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fcd34d;
}

.av-sync--no_va_slot,
.av-sync--no_model {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.av-readonly-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0;
}

.av-hist-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

.av-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.av-empty {
  padding: 1.25rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.av-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.75rem 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.av-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
}

.av-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.av-card-id {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.av-card-id-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.av-card-id-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.av-acc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.av-acc-avatar--hero {
  width: 52px;
  height: 52px;
}

.av-acc-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f9a8d4;
  background: rgba(233, 30, 140, 0.14);
}

.av-card-user {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.vault-handle-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  max-width: 100%;
}

.vault-handle-row .ops-vault-acc-link,
.vault-handle-row > strong {
  min-width: 0;
}

.vault-handle-row .av-ext-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1;
  border-radius: 6px;
}

.av-copy-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.av-copy-icon:hover {
  opacity: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.av-copy-icon:focus-visible {
  outline: 1px solid rgba(167, 139, 250, 0.55);
  outline-offset: 1px;
  opacity: 1;
}

.av-copy-icon svg {
  width: 13px;
  height: 13px;
  display: block;
}

.av-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.av-card-tags .ops-pill {
  font-size: 0.72rem;
}

.ops-vault-list-head {
  margin-top: 0.75rem;
}

.av-card-assign {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.av-assign-chip {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.82rem;
}

.av-assign-chip .av-field-lbl {
  margin: 0;
}

.av-card-creds {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  align-items: start;
}

.av-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.av-field-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.av-field-val {
  font-size: 0.82rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.av-field-val .av-copyable {
  display: flex;
  width: 100%;
  min-width: 0;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}

.av-copyable {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  min-width: 0;
}

.av-copyable-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.av-copyable-text:focus {
  outline: 1px solid rgba(96, 165, 250, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

.av-copy {
  flex-shrink: 0;
  padding: 0.12rem 0.4rem !important;
  min-width: auto;
  font-size: 0.65rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.av-secret-val:not([hidden]) {
  user-select: all;
  cursor: text;
  max-width: min(100%, 14rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.av-table td .av-copyable,
.av-table td .av-secret {
  max-width: 12rem;
}

@media (max-width: 900px) {
  .av-table td .av-copyable,
  .av-table td .av-secret {
    max-width: 9rem;
  }
}

.av-field--notes .av-field-val {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  color: var(--muted);
  line-height: 1.35;
}

.av-field--notes .av-field-val:empty {
  min-height: 0;
}

.av-secret {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  max-width: 100%;
}

.av-secret-mask {
  letter-spacing: 0.12em;
  color: var(--muted);
}

.av-reveal {
  padding: 0.15rem 0.35rem !important;
  min-width: auto;
  line-height: 1;
  flex-shrink: 0;
}

.av-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
  margin-left: auto;
}

.av-del {
  color: #f87171 !important;
}

.av-status {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.av-aged {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.av-aged--yes {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}
.av-aged--no {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.av-funnel-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
}

.av-funnel-field .av-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
}

.av-status--available {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.av-status--assigned {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.av-status--banned {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.av-status--warmup {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.av-status--archived {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.btn-xs {
  font-size: 0.72rem;
  padding: 0.2rem 0.4rem;
}

.av-field--2fa .av-field-val {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  white-space: normal;
  overflow: visible;
}

.av-2fa-vis-wrap,
.av-2fa-vis-field {
  margin-top: 0.15rem;
}

.av-2fa-vis-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.av-2fa-vis-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.av-2fa-vis-btn--on {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.av-2fa-vis-btn--on .av-2fa-vis-icon {
  color: #22c55e;
}

.av-2fa-vis-btn--off {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

.av-2fa-vis-btn--off .av-2fa-vis-icon {
  color: #ef4444;
}

.av-2fa-vis-icon {
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
}

/* Truncated text + hover tooltip (shared with operations) */
.ops-link-tip-wrap {
  position: relative;
  display: block;
  min-width: 0;
  max-width: 100%;
}
.ops-link-tip-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-link-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  padding: 0.4rem 0.65rem;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #f1f5f9;
  white-space: nowrap;
  z-index: 60;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}
.ops-link-tip-wrap:hover .ops-link-tip,
.ops-link-tip-wrap:focus-within .ops-link-tip {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1200px) {
  .av-card-creds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .av-field--notes {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .av-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .av-actions {
    margin-left: 0;
    justify-content: flex-start;
  }
  .av-card-creds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .av-card-creds {
    grid-template-columns: 1fr;
  }
}
