/* Bóveda de Seguridad — almacén cifrado de credenciales. */
:root { --ws-boveda: #C08A3E; }

/* Buscador + filtros: todo en una sola barra, junto al buscador. */
.vault-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 4px 0 16px; }
.vault-search { flex: 0 1 340px; max-width: 340px; margin: 0; }
.vault-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; flex: 1 1 280px; }
.vault-chips .chip b { font-weight: 700; opacity: .55; margin-left: 3px; font-size: 12px; }
.chip.chip-fav .i { color: var(--ws-boveda); }
.chip.chip-fav.is-active .i { color: inherit; }
.chip.bump { animation: chip-bump .42s var(--ease-out, ease); }
@keyframes chip-bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* Icono de la clave */
.vault-ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: var(--c, var(--ws-boveda));
  background: color-mix(in srgb, var(--c, var(--ws-boveda)) 14%, transparent);
}
.vault-ico.lg { width: 52px; height: 52px; border-radius: 15px; }

/* Lista de entradas */
.vault-list { padding: 6px; }
.vault-row { display: flex; align-items: center; border-radius: 12px; transition: background var(--t, .18s) var(--ease-out, ease); }
.vault-row + .vault-row { border-top: 1px solid var(--line); border-radius: 0; }
.vault-row:hover { background: var(--surface-2); border-radius: 12px; }
.vault-row:hover + .vault-row { border-top-color: transparent; }
.vault-row-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; color: inherit; text-decoration: none;
}
.vault-row-main { flex: 1; min-width: 0; }
.vault-row-title { font-weight: 600; display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-row-sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-row-end { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }

/* Estrella de favorito (lista y detalle) */
.vault-fav-btn {
  flex: none; width: 36px; height: 36px; margin-right: 8px; border: 0; background: transparent;
  color: var(--ink-3); cursor: pointer; display: grid; place-items: center; border-radius: 10px;
  transition: color .18s, background .18s;
}
.vault-fav-btn:hover { background: var(--surface-2); color: var(--ws-boveda); }
.vault-fav-btn.is-fav { color: var(--ws-boveda); }
.vault-fav-btn.is-fav .i { fill: currentColor; }
.vault-fav-btn.pop { animation: fav-pop .42s var(--ease-out, ease); }
@keyframes fav-pop { 0% { transform: scale(1); } 35% { transform: scale(1.4); } 60% { transform: scale(.85); } 100% { transform: scale(1); } }
.vault-fav-ghost { position: fixed; z-index: 2000; pointer-events: none; color: var(--ws-boveda); transform: translate(-50%, -50%); }
.vault-fav-ghost .i { fill: currentColor; width: 20px; height: 20px; }

/* Detalle */
.vault-detail-head { align-items: flex-start; }
.vault-detail { padding: 6px 4px; }
.vault-field { padding: 12px 14px; }
.vault-field + .vault-field { border-top: 1px solid var(--line); }
.vf-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.vf-label .i { opacity: .8; }
.vf-value { display: flex; align-items: center; gap: 10px; }
.vf-text { font-family: var(--font-mono); font-size: 15px; word-break: break-all; flex: 1; min-width: 0; }
.vf-text.is-secret { letter-spacing: 2px; }
.vf-text.vf-error { color: var(--danger); letter-spacing: 0; font-size: 13px; font-family: inherit; }
.vf-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.vault-notes { padding: 12px 14px; border-top: 1px solid var(--line); }
.vault-notes p { margin: 4px 0 0; white-space: pre-wrap; color: var(--ink-2); }

/* Editor */
.vault-form { display: flex; flex-direction: column; gap: 14px; }
.vfield { display: flex; flex-direction: column; gap: 6px; }
.vfield > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.vault-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vfield-pass { display: flex; align-items: center; gap: 6px; }
.vfield-pass .input { flex: 1; }
.vfield-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.vfield-check input { accent-color: var(--ws-boveda); }
.vfield-extra-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.vfield-extra-head > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.vfield-list { display: flex; flex-direction: column; gap: 8px; }
.vfield-row { display: grid; grid-template-columns: 116px 1fr 1.1fr auto auto; gap: 8px; align-items: center; }
.vfield-type { font-size: 12.5px; padding: 8px 6px; }
.vfield-secret { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.vfield-secret input { accent-color: var(--ws-boveda); }

/* Selector de icono + color */
.vault-iconpick { display: flex; align-items: center; gap: 10px; }
.vault-iconpreview {
  width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line); cursor: pointer;
  display: grid; place-items: center; color: var(--c, var(--ws-boveda));
  background: color-mix(in srgb, var(--c, var(--ws-boveda)) 15%, transparent); transition: transform .12s var(--ease-out, ease);
}
.vault-iconpreview:hover { transform: translateY(-1px); }
.vault-iconpanel {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  background: var(--surface-2); display: flex; flex-direction: column; gap: 12px;
}
.vault-iconpanel[hidden] { display: none; }
.vault-colorrow { display: flex; flex-wrap: wrap; gap: 8px; }
.vault-color {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  background: var(--c, var(--ws-boveda)); display: grid; place-items: center; color: #fff; transition: transform .12s;
}
.vault-color:hover { transform: scale(1.1); }
.vault-color.is-sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c, var(--ws-boveda)); }
.vault-icongrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; }
.vault-iconopt {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-1, var(--surface));
  cursor: pointer; display: grid; place-items: center; color: var(--ink-2); transition: color .12s, background .12s, border-color .12s;
}
.vault-iconopt:hover { color: var(--ws-boveda); border-color: var(--ws-boveda); }
.vault-iconopt.is-sel { color: #fff; background: var(--ws-boveda); border-color: var(--ws-boveda); }

/* Importador */
.vault-import { display: flex; flex-direction: column; gap: 12px; }
.vault-import-ta { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; resize: vertical; }
.vault-import-status { min-height: 18px; }

@media (max-width: 700px) {
  .vault-search { flex-basis: 100%; max-width: 100%; }
  .vault-grid-2 { grid-template-columns: 1fr; }
  .vfield-row { grid-template-columns: 1fr 1fr; }
  .vfield-row .vfield-type { grid-column: 1 / -1; }
  .vfield-secret { grid-column: 1; }
}
