/* Alertas, notificaciones flotantes, modales y menús desplegables */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.45;
}
.alert .ico { width: 18px; height: 18px; margin-top: 1px; }
.alert--success { background: var(--mint); color: var(--mint-ink); }
.alert--error { background: var(--coral-tint); color: var(--coral-ink); }
.alert--info { background: var(--sky); color: var(--sky-ink); }

/* Notificaciones flotantes */
.toasts {
  position: fixed;
  right: 16px; bottom: 16px; left: 16px;
  z-index: 400;
  display: grid;
  justify-items: end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  pointer-events: auto;
  animation: toast-in .3s var(--ease);
}
.toast .ico { width: 18px; height: 18px; color: #8fe0ad; }
.toast--error .ico { color: #ffab9c; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }

/* Modal con <dialog> */
.modal {
  width: min(620px, 100% - 24px);
  max-height: calc(100% - 24px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
.modal--sm { width: min(420px, 100% - 24px); }
.modal::backdrop { background: rgba(20, 20, 26, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .25s var(--ease); }
.modal > form { display: flex; flex-direction: column; max-height: inherit; }

.modal__header { display: flex; align-items: center; gap: 14px; padding: 22px 22px 0; }
.modal__header > div { flex: 1; min-width: 0; }
.modal__badge { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px; }
.modal__badge .ico { width: 21px; height: 21px; }
.modal__title { margin: 0; font-size: 1.2rem; }
.modal__subtitle { margin: 2px 0 0; color: var(--muted); font-size: .84rem; }
.modal__body { display: grid; gap: 18px; padding: 20px 22px; overflow-y: auto; }
.modal__body--center { justify-items: center; padding-top: 28px; text-align: center; }
.modal__icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--cream); color: var(--cream-ink); }
.modal__icon .ico { width: 24px; height: 24px; }
.modal__icon.is-danger { background: var(--coral-tint); color: var(--coral-ink); }
.modal__text { margin: 0; color: var(--muted); font-size: .9rem; }
.modal__footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 22px; border-top: 1px solid var(--line); }
.modal__footer--center { justify-content: center; border-top: 0; padding-top: 0; }

/* Menú desplegable */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 250px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: modal-in .2s var(--ease);
}
.dropdown__header { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown__header small { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.dropdown__header .pill { justify-self: start; margin-top: 6px; }
.dropdown form { margin: 0; }
.dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.dropdown__item:hover { background: var(--surface-2); }
.dropdown__item .ico { width: 17px; height: 17px; color: var(--muted); }

@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
