/* ===========================================================================
   DIÁLOGOS — Preferencias, Notas, Compartir nota, Correo enviado,
   Actualizar contenido y Búsqueda de elemento (dialogs.dart y compañía).
   =========================================================================== */

.dlg-title { font-size: 26px; font-weight: 800; color: var(--navy); }

/* ------------------------------ INTERRUPTOR ------------------------------ */
.switch {
  position: relative;
  width: 46px;
  height: 27px;
  flex: none;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: #D4D8DF;
  transition: background 160ms ease;
}
.switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease;
}
.switch input:checked + .track { background: var(--blue); }
.switch input:checked ~ .thumb { transform: translateX(19px); }

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6.5px 0;
}
.switch-row .sr-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

/* Desplegable estándar de los diálogos */
.dlg-select {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--navy);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 8px 12px;
  background: #fff;
}

/* ------------------------------ PREFERENCIAS ----------------------------- */
.prefs-dialog {
  width: min(720px, calc(100vw - 80px));
  padding: 26px;
  border-radius: 28px;
}
.prefs-cols { display: flex; gap: 28px; margin-top: 18px; }
.prefs-col { flex: 1; min-width: 0; }
.prefs-label { font-size: 12.5px; color: var(--navy-soft); margin-bottom: 6px; }
.prefs-version {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--navy);
  background: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  outline: none;
}
.prefs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.prefs-row .pr-label { flex: 1; font-size: 15px; font-weight: 600; color: var(--navy); }

.prefs-update-btn {
  margin-top: 18px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 0;
  border-radius: 12px;
  border: 1.4px solid var(--blue);
  color: var(--blue);
  font-size: 14.5px;
  font-weight: 700;
  transition: background 140ms ease;
}
.prefs-update-btn:hover { background: rgba(30, 150, 255, 0.08); }
.prefs-update-sub { margin-top: 6px; font-size: 12px; color: var(--navy-soft); }

.prefs-dev {
  margin-top: 18px;
  padding: 11px 14px;
  background: #F5F6F8;
  border: 1px solid #E2E4E9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.prefs-dev img { max-width: 230px; max-height: 64px; object-fit: contain; }
.prefs-dev .dev-links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.prefs-dev .dev-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.prefs-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 12px; }

/* ------------------------------ NOTAS ------------------------------------ */
.notes-dialog { width: 620px; max-width: calc(100vw - 60px); padding: 26px; border-radius: 28px; }
.notes-head { display: flex; align-items: center; }
.notes-head .dlg-title { font-size: 28px; }
.notes-share-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 22px;
  border: 1.4px solid var(--navy);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  transition: background 140ms ease;
}
.notes-share-btn:hover { background: rgba(34, 57, 91, 0.06); }

.notes-paper {
  margin-top: 20px;
  height: 330px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
}
.notes-paper textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 39.3px,
      #E3E5EA 39.3px,
      #E3E5EA 40.3px
    ) local;
  background-position: 0 14px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 16.5px;
  line-height: 40.3px;
  color: var(--navy);
  caret-color: var(--blue);
}
.notes-paper textarea::placeholder { color: var(--navy-soft); }

/* ------------------------------ COMPARTIR NOTA --------------------------- */
.share-note-dialog { width: 520px; max-width: calc(100vw - 60px); padding: 26px; border-radius: 28px; }
.share-note-dialog .from { margin-top: 6px; font-size: 13px; color: var(--navy-soft); }
.contact-list { margin-top: 18px; background: #fff; border-radius: 16px; overflow: hidden; }
.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 120ms ease;
}
.contact-row:hover { background: rgba(30, 150, 255, 0.06); }
.contact-row + .contact-row { border-top: 1px solid var(--divider); }
.contact-row .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(30, 150, 255, 0.15);
  color: var(--blue);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.contact-row .cr-main { flex: 1; min-width: 0; }
.contact-row .cr-name { font-size: 14.5px; font-weight: 700; color: var(--navy); }
.contact-row .cr-mail { font-size: 12.5px; color: var(--navy-soft); }
.contact-row .send { color: var(--blue); display: flex; }
.share-note-actions { margin-top: 18px; display: flex; justify-content: flex-end; }

/* ------------------------------ CORREO ENVIADO --------------------------- */
.mail-dialog {
  width: 360px;
  background: #fff;
  border-radius: 18px;
  padding: 30px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.mail-dialog .spinner {
  width: 46px;
  height: 46px;
  border: 3.2px solid transparent;
  border-top-color: var(--blue);
  border-right-color: var(--blue);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
.mail-dialog .sending-txt { margin-top: 22px; font-size: 17px; font-weight: 700; color: var(--dark); }
.mail-dialog .check {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: rgba(53, 199, 89, 0.14);
  color: var(--green-ok);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop-in 440ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop-in { from { transform: scale(0); } to { transform: scale(1); } }
.mail-dialog .sent-title { margin-top: 20px; font-size: 19px; font-weight: 800; color: var(--dark); }
.mail-dialog .sent-desc { margin-top: 8px; font-size: 14px; color: var(--grey); line-height: 1.35; }
.mail-dialog .accept {
  margin-top: 24px;
  width: 100%;
  padding: 13px 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

/* ------------------------------ ACTUALIZAR CONTENIDO --------------------- */
.update-dialog { width: min(460px, calc(100vw - 80px)); padding: 24px; border-radius: 24px; }
.update-head { display: flex; align-items: center; gap: 14px; }
.update-head .badge {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 240ms ease;
}
.update-head.done .badge { background: #2BA86A; }
.update-head .ut { flex: 1; font-size: 18px; font-weight: 800; color: var(--navy); }
.update-bar {
  margin-top: 18px;
  height: 8px;
  border-radius: 8px;
  background: #E6E9EF;
  overflow: hidden;
}
.update-bar > i { display: block; height: 100%; width: 0%; background: var(--blue); }
.update-bar.done > i { background: #2BA86A; }
.update-pct { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--navy-soft); }
.update-items { margin-top: 14px; }
.update-item { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.update-item .tick {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.update-item .mini-spin {
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: var(--blue);
  border-right-color: var(--blue);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
.update-item .lbl { font-size: 14px; font-weight: 600; color: var(--navy-soft); }
.update-item.ok .lbl { color: var(--navy); }
.update-actions { margin-top: 18px; display: flex; justify-content: flex-end; }
.update-actions .btn-primary.disabled { opacity: 0.45; cursor: default; }

/* ------------------------------ BÚSQUEDA DE ELEMENTO --------------------- */
.search-dialog {
  width: 460px;
  max-width: calc(100vw - 60px);
  background: #fff;
  border-radius: 18px;
  padding: 18px 16px 22px 24px;
}
.search-head { display: flex; align-items: center; gap: 10px; }
.search-head .st { flex: 1; font-size: 18px; font-weight: 800; color: var(--dark); }
.search-head .x { cursor: pointer; color: #1C2230; display: flex; padding: 8px; border-radius: 10px; }
.search-head .x:hover { background: rgba(0, 0, 0, 0.05); }
.search-field {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F5F7FA;
  border: 1.2px solid #E3E7EE;
  border-radius: 12px;
  padding: 0 12px;
  margin-right: 8px;
}
.search-field:focus-within { border: 1.6px solid var(--blue); }
.search-field .material-symbols-outlined { color: #9AA2B1; font-size: 20px; }
.search-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  padding: 14px 0;
}
.search-field input::placeholder { color: #9AA2B1; font-weight: 500; }
.search-notfound {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #D5443B;
  font-size: 13.5px;
  font-weight: 600;
}
.search-actions { margin-top: 18px; display: flex; justify-content: flex-end; margin-right: 8px; }
