.auth-card { max-width: 380px; margin: 60px auto; }
.profile-card { max-width: 720px; }
.profile-grid { display: grid; grid-template-columns: 200px 1fr;
                gap: 10px; align-items: center; }
/* ==================== ПАЛИТРА ЦВЕТОВ СМЕН ==================== */

.color-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  transition: transform .12s ease, border-color .12s ease;
}

.color-swatch:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.color-swatch.active {
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--primary);
}

.current-color-box {
  display: inline-block;
  width: 20px;
  height: 14px;
  border: 1px solid #999;
  vertical-align: -2px;
  margin: 0 4px;
}

.color-picker-input {
  width: 70px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
}

.color-preview {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.color-preview-cell {
  width: 60px;
  height: 40px;
  border-radius: 4px;
  border: 1px solid #999;
}
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr);
                  gap: 8px; margin: 16px 0; }
.recovery-codes code { padding: 8px 12px; background: var(--th-bg);
  border-radius: 4px; font-size: 16px; letter-spacing: 2px;
  text-align: center; user-select: all; }
@media (max-width: 600px) { .profile-grid { grid-template-columns: 1fr; } }

/* ==================== ПРОФИЛЬ (2 КОЛОНКИ) ==================== */
.profile-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.profile-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0; /* важно для flex-контейнера */
}

@media (max-width: 950px) {
  .profile-layout {
    flex-direction: column;
  }
}
/* ==================== ПЕРЕКЛЮЧАТЕЛИ УВЕДОМЛЕНИЙ ==================== */
.tg-group {
  margin-bottom: 20px;
}
.tg-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mut);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 4px;
}
.tg-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease;
  margin: 0;
}
.tg-row:hover {
  background: var(--th-bg);
}
.tg-row span {
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
}
.tg-row small {
  font-size: 11px;
  display: block;
  margin-top: 2px;
}

/* Стилизация switch (тумблера) */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}
[data-theme="dark"] .slider { background-color: #4a5561; }
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .slider {
  background-color: var(--primary);
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
/* ==================== ВКЛАДКИ ПРОФИЛЯ (audit-style) ==================== */
.audit-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.audit-tab {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--th-bg);
  color: var(--text-mut);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s ease;
  margin-bottom: -2px;
}
.audit-tab:hover {
  background: var(--bg-card);
  color: var(--primary);
  text-decoration: none;
}
.audit-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  border-bottom: 2px solid var(--bg-card);
  font-weight: 600;
}

/* Tab 4: переиспользуем .security-container, но сузим до одного столбца карточек */
.profile-grid {
  grid-template-columns: 180px 1fr;
}

@media (max-width: 600px) {
  .audit-tab {
    padding: 8px 12px;
    font-size: 13px;
  }
}
/* ==================== СЕТКА ДЛЯ ПРОФИЛЯ ==================== */
.profile-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 20px;
  align-items: start;
}

/* Для уведомлений лучше одна широкая колонка */
.profile-container.single-col {
  grid-template-columns: 1fr;
  max-width: 800px;
}

@media (max-width: 950px) {
  .profile-container {
    grid-template-columns: 1fr;
  }
}
