/* Finestra Impostazioni — master/detail (stesso schema finestra Account) */

.win-settings {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  color: var(--text-1);
}

.set-shell {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.set-nav {
  flex: 0 0 200px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.set-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.set-nav-item:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.05);
}

.set-nav-item.active {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 var(--accent);
}

.set-nav-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.set-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.set-detail {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px 18px;
}

.set-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.set-detail-icon {
  font-size: 1.5rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.set-detail-title {
  margin: 0;
  font-size: 1rem;
  color: var(--text-1);
}

.set-detail-sub {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.4;
}

.set-detail-body {
  padding-top: 2px;
  min-height: 0;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.set-row:last-child {
  border-bottom: none;
}

.set-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.set-row-main strong {
  font-size: 0.85rem;
  color: var(--text-1);
  font-weight: 600;
}

.set-row-hint {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 2px;
}

.set-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.set-btn {
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-1);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, filter 0.12s;
  white-space: nowrap;
}

.set-btn:hover:not(:disabled) {
  background: var(--bg-hover);
}

.set-btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.set-btn.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.set-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.set-pin-input {
  width: 72px;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-1);
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0.3em;
}

.set-pin-input:focus {
  outline: none;
  border-color: var(--accent);
}

.set-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--text-2);
}

.set-note.ok {
  color: #a5d6a7;
}

.set-note.warn {
  color: #ffb74d;
}

/* Interruttore on/off */
.set-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.set-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.set-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.15s;
  cursor: pointer;
}

.set-switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.set-switch input:checked + .set-switch-slider {
  background: var(--accent);
}

.set-switch input:checked + .set-switch-slider::before {
  transform: translateX(18px);
}

.set-switch input:disabled + .set-switch-slider {
  opacity: 0.5;
  cursor: default;
}

/* Metodi di pagamento */
.set-payments-layout {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}
.set-pay-navlist { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow: auto; }
.set-pay-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--text-2); cursor: pointer; text-align: left; font-size: 13px;
}
.set-pay-nav:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-1); }
.set-pay-nav.active { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.1); color: var(--text-1); box-shadow: inset 3px 0 0 var(--accent); }
.set-pay-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); flex-shrink: 0; }
.set-pay-dot.ok { background: #6bcf8a; }
.set-pay-dot.warn { background: #ffd43b; }
.set-pay-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.15);
  min-height: 0;
  overflow: auto;
}
.set-pay-form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.set-pay-form-head h4 { margin: 0; font-size: 14px; }
.set-pay-fields { display: grid; gap: 10px; margin-bottom: 12px; }
.set-field label { display: block; font-size: 12px; margin-bottom: 4px; color: var(--text-2); }
.set-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.2); color: inherit; font: inherit; }
.set-check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.set-pay-modules { margin: 12px 0; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.set-pay-modules strong { display: block; font-size: 12px; margin-bottom: 6px; }
.set-pay-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.set-pay-msg { font-size: 12px; }
.set-pay-msg.ok { color: #6bcf8a; }
.set-pay-msg.bad { color: #ff8a80; }
.set-note.ok { color: #6bcf8a; }
.set-note.warn { color: #ffd43b; }
.set-pay-decoy {
  position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none;
  left: -9999px; top: 0; overflow: hidden;
}
.set-pay-form { position: relative; }
.set-pay-sensitive[readonly] { cursor: text; }

/* Identità visiva */
.set-brand-block { margin-bottom: 18px; }
.set-brand-block > strong { display: block; font-size: 12px; margin-bottom: 8px; color: var(--text-1); }
.set-brand-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.set-brand-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.set-brand-chip:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-1); }
.set-brand-chip.active { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--accent); }
.set-brand-presets { display: flex; flex-wrap: wrap; gap: 10px; }
.set-brand-preset {
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
  cursor: pointer;
  width: 92px;
}
.set-brand-preset.active { border-color: var(--accent); }
.set-brand-swatch { height: 40px; border-radius: 8px; display: flex; overflow: hidden; }
.set-brand-swatch span { flex: 1; }
.set-brand-preset-name { font-size: 11px; font-weight: 600; text-align: center; margin-top: 6px; color: var(--text-2); display: block; }
.set-brand-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.set-brand-color { display: flex; flex-direction: column; gap: 4px; }
.set-brand-color input[type="color"] { width: 100%; height: 36px; border: none; border-radius: 8px; cursor: pointer; padding: 0; background: transparent; }
.set-brand-color label { font-size: 11px; color: var(--text-2); }
.set-brand-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.set-brand-msg { font-size: 12px; }
.set-brand-msg.ok { color: #6bcf8a; }
.set-brand-msg.bad { color: #ff8a80; }

/* Posta */
.set-mail-layout {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}
.set-mail-navlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}
.set-mail-nav {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 12px;
}
.set-mail-nav:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-1); }
.set-mail-nav.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-1);
  box-shadow: inset 3px 0 0 var(--accent);
}
.set-mail-nav-main { min-width: 0; flex: 1; }
.set-mail-nav-label { display: block; font-weight: 600; color: var(--text-1); }
.set-mail-nav-email { display: block; font-size: 11px; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-mail-slot {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.set-mail-slot.free { background: rgba(107, 207, 138, 0.15); color: #6bcf8a; }
.set-mail-slot.paid { background: rgba(255, 212, 59, 0.12); color: #ffd43b; }
.set-mail-add {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.set-mail-add:hover { border-color: var(--accent); color: var(--text-1); }
.set-mail-add-hint { margin-left: auto; font-size: 10px; opacity: 0.8; }
.set-mail-empty-nav { padding: 8px 4px; }
.set-mail-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.15);
  min-height: 0;
  overflow: auto;
}
.set-mail-block {
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.set-mail-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.set-mail-block-head strong { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.set-mail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.set-mail-span2 { grid-column: 1 / -1; }
.set-mail-sync-row { margin-top: 8px; align-items: flex-start; }
.set-mail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.set-mail-msg { font-size: 12px; }
.set-mail-msg.ok { color: #6bcf8a; }
.set-mail-msg.bad { color: #ff8a80; }
.set-mail-sensitive[readonly] { cursor: text; }
