/* ==========================================================================
   modules/configuraciones.css - Configuraciones personales del usuario.
   Fase 1: movido TAL CUAL desde tqc.css (orden preservado => cascada identica).
   ========================================================================== */
/* ===== Configuraciones personales ===== */
.leader-scope-fields { margin: 1rem 0 1.25rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); }
.leader-scope-fields legend { padding: 0 .45rem; color: var(--primary); font-weight: 700; }
.leader-toggle { display: inline-flex; align-items: center; gap: .55rem; margin: .7rem 0 1rem; }
.leader-toggle input { width: 1.05rem; height: 1.05rem; margin: 0; }
.leader-toggle label { margin: 0; font-weight: 700; }
.scope-switch { display: flex; width: min(100%, 9rem); height: 1.65rem; margin-top: .45rem; border: 1px solid var(--line); border-radius: .45rem; overflow: hidden; background: #f8fafc; }
.scope-segment { position: relative; flex: 1 1 0; cursor: pointer; border-right: 1px solid var(--line); }
.scope-segment:last-child { border-right: 0; }
.scope-segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.scope-segment span { display: block; width: 100%; height: 100%; transition: filter .15s, box-shadow .15s; }
.scope-INSPECCION span { background: #fee2e2; }
.scope-AMBOS span { background: #fef3c7; }
.scope-QAQC span { background: #dcfce7; }
.scope- input:checked + span { background: #e5e7eb; }
.scope-INSPECCION input:checked + span { background: #dc2626; box-shadow: inset 0 0 0 2px #991b1b, 0 0 8px #dc2626; }
.scope-AMBOS input:checked + span { background: #eab308; box-shadow: inset 0 0 0 2px #a16207, 0 0 8px #eab308; }
.scope-QAQC input:checked + span { background: #16a34a; box-shadow: inset 0 0 0 2px #166534, 0 0 8px #16a34a; }
.scope-base-label { display: block; font-weight: 700; color: var(--primary); }
body[data-user-theme="halloween"] {
  --primary: #7c2d12;
  --primary-2: #ea580c;
  --soft-blue: #fff3e6;
  --tqc-header: #241018;
  --tqc-header-2: #5a1f0f;
  --tqc-yellow: #ff8a00;
  --text: #24140f;
}
body[data-user-theme="navidad"] {
  --primary: #0f6b45;
  --primary-2: #b91c1c;
  --soft-blue: #edf8f1;
  --tqc-header: #0b3b2e;
  --tqc-header-2: #7f1d1d;
  --tqc-yellow: #f8d66d;
  --text: #11251d;
}
body[data-user-theme="verde"] {
  --primary: #087047;
  --primary-2: #0f8f5f;
  --soft-blue: #e7f8ef;
  --tqc-header: #083b2b;
  --tqc-header-2: #0f5a3d;
  --text: #10251d;
}
body[data-user-theme="cancer_mama"] {
  --primary: #be185d;
  --primary-2: #ec4899;
  --soft-blue: #fff0f6;
  --tqc-header: #831843;
  --tqc-header-2: #be185d;
  --tqc-yellow: #ffd6e7;
  --text: #351121;
}
body[data-user-theme="medio_ambiente"] {
  --primary: #166534;
  --primary-2: #0284c7;
  --soft-blue: #ecfdf5;
  --tqc-header: #064e3b;
  --tqc-header-2: #075985;
  --tqc-yellow: #a7f3d0;
  --text: #10251d;
}
body[data-user-theme="tqc_alternativo"] {
  --primary: #0f766e;
  --primary-2: #2563eb;
  --soft-blue: #eefaf8;
  --tqc-header: #102a43;
  --tqc-header-2: #0f766e;
  --tqc-yellow: #38bdf8;
  --text: #122033;
}
body[data-theme-template="limpio"] {
  background: var(--user-bg-color, var(--bg));
}
body[data-theme-template="suave"] {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .86), rgba(238, 245, 255, .78)),
    repeating-linear-gradient(45deg, var(--user-bg-color, #f4f7fb) 0 18px, rgba(255, 255, 255, .72) 18px 36px);
}
body[data-theme-template="tecnico"] {
  background:
    linear-gradient(rgba(255, 255, 255, .72), rgba(255, 255, 255, .72)),
    linear-gradient(90deg, rgba(18, 63, 140, .08) 1px, transparent 1px),
    linear-gradient(rgba(18, 63, 140, .08) 1px, transparent 1px),
    var(--user-bg-color, #f4f7fb);
  background-size: auto, 32px 32px, 32px 32px, auto;
}
body[data-theme-template="compacto"] {
  background:
    linear-gradient(180deg, rgba(7, 27, 58, .05), transparent 220px),
    var(--user-bg-color, #f4f7fb);
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.settings-header {
  align-items: center;
}
.settings-avatar-preview {
  width: 76px;
  min-width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--user-accent-text);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .55), transparent 34%),
    linear-gradient(135deg, var(--user-accent), var(--user-accent-2));
  font-size: 30px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 12px 28px rgba(3, 11, 26, .18);
  overflow: hidden;
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
  gap: 18px;
  align-items: start;
}
.settings-card {
  border-radius: var(--radius-lg);
}
.settings-card-head {
  margin-bottom: 16px;
}
.settings-card-head p {
  margin: 6px 0 0;
}
.settings-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-password-grid {
  grid-template-columns: 1fr;
}
.form-field ul,
.errorlist {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}
.settings-theme-options {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f8fafc;
}
.settings-theme-options > span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.theme-option-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.theme-chip {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, .12);
  font-size: 12px;
  font-weight: 900;
}
.theme-clasico { color: #071B3A; background: linear-gradient(135deg, #eef5ff, #ffc000); }
.theme-halloween { color: #ffffff; background: linear-gradient(135deg, #241018, #ea580c); }
.theme-navidad { color: #ffffff; background: linear-gradient(135deg, #0f6b45, #b91c1c); }
.theme-verde { color: #083b2b; background: linear-gradient(135deg, #dcfce7, #8dd9b6); }
.theme-cancer-mama { color: #831843; background: linear-gradient(135deg, #fff0f6, #ec4899); }
.theme-medio-ambiente { color: #064e3b; background: linear-gradient(135deg, #a7f3d0, #0284c7); }
.theme-tqc-alternativo { color: #ffffff; background: linear-gradient(135deg, #102a43, #0f766e, #38bdf8); }
.settings-note {
  margin-top: 14px;
  padding: 12px 14px;
  color: #344054;
  background: #fff7e6;
  border: 1px solid rgba(154, 97, 0, .22);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .settings-layout,
  .settings-form-grid,
  .theme-option-list {
    grid-template-columns: 1fr;
  }
  .settings-avatar-preview {
    width: 64px;
    min-width: 64px;
    height: 64px;
  }
}
