/* ===== ШРИФТЫ ===== */
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600;700&family=Nunito:wght@400;600;700&family=Rubik:wght@400;500;600&display=swap');

/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
  --bg: #FDF6EC;
  --block: #F5E6D3;
  --header: #F7D9C4;
  --accent: #A8C99A;
  --accent-hover: #8FBF7F;
  --error: #F5A9A9;
  --text: #5C4B3A;
  --text-muted: #8A7A6A;
  --border: #C9B89A;
  --shadow: 0 2px 8px rgba(92, 75, 58, 0.08);
  --sidebar-width: 260px;
    --shadow-sm: 0 2px 6px rgba(92, 75, 58, 0.06);
  --shadow-md: 0 4px 14px rgba(92, 75, 58, 0.10);
  --shadow-lg: 0 8px 28px rgba(92, 75, 58, 0.16);
  --shadow-glow: 0 0 0 4px rgba(168, 201, 154, 0.2);
}

/* ===== СБРОС ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-image, none);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s ease, color 0.4s ease, background-image 0.3s ease;
}

/* =====================================================
   ТОПБАР
   ===================================================== */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 24px;
  height: 40px;
  box-sizing: border-box;
  background: var(--block);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex-shrink: 0;
  transition: background-color 0.3s ease;
  -webkit-app-region: drag;
}

.menu-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
    -webkit-app-region: no-drag;
}

.menu-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.menu-btn:active {
  transform: scale(0.96);
}

.logo {
  font-family: 'Comfortaa', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
    -webkit-app-region: no-drag;
}

.logo i {
  color: var(--accent-hover);
  font-size: 22px;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ НЕДЕЛЬ ===== */
.week-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  margin-left: auto;
  margin-right: 150px;
    -webkit-app-region: no-drag;
}

.week-btn,
.week-label,
.week-dropdown {
  -webkit-app-region: no-drag;
}

.week-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.week-btn:active {
  transform: scale(0.94);
}

.week-label {
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.week-label:hover {
  background: var(--header);
  border-color: var(--accent);
}

.week-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 260px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(92, 75, 58, 0.18);
  z-index: 200;
  padding: 6px;
}

.week-dropdown.open {
  display: block;
  animation: dropdownSlide 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.week-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  position: relative;
}

.week-dropdown-item:hover {
  background: var(--header);
}

.week-dropdown-item.active {
  background: var(--accent-hover);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.week-dropdown-item.active .current-mark {
  color: #FFFFFF;
  opacity: 1;
}

.week-dropdown-item .current-mark {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
  margin-left: 8px;
  flex-shrink: 0;
}

/* =====================================================
   БОКОВАЯ ШТОРКА
   ===================================================== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(92, 75, 58, 0.4);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--block);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(92, 75, 58, 0.15);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px 20px;
  padding-top: 48px; /* ← 40px нативная полоса + 8px запас */
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-family: 'Comfortaa', cursive;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo i {
  color: var(--accent-hover);
  font-size: 20px;
}

.sidebar-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  background: var(--error);
  color: #FFFFFF;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 16px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    padding-left 0.3s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.25s ease;
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Акцентная полоска слева — растёт при hover */
.sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}

.sidebar-item i {
  font-size: 20px;
  color: var(--text-muted);
  transition: color 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

/* Hover */
.sidebar-item:hover {
  background: var(--header);
  padding-left: 20px;
  color: var(--text);
}

.sidebar-item:hover::before {
  transform: translateY(-50%) scaleY(1);
}

.sidebar-item:hover i {
  color: var(--accent-hover);
  transform: scale(1.1);
}

/* Активный */
.sidebar-item.active {
  background: var(--accent);
  color: #FFFFFF;
  padding-left: 20px;
  box-shadow: 0 4px 12px rgba(168, 201, 154, 0.3);
}

.sidebar-item.active::before {
  transform: translateY(-50%) scaleY(1);
  background: #FFFFFF;
  width: 4px;
}

.sidebar-item.active i {
  color: #FFFFFF;
}

body.theme-pink .sidebar-item.active {
  box-shadow: 0 4px 12px rgba(212, 138, 138, 0.3);
}

body.theme-blue .sidebar-item.active {
  box-shadow: 0 4px 12px rgba(138, 155, 196, 0.3);
}

body.theme-dark .sidebar-item.active {
  box-shadow: 0 4px 12px rgba(201, 168, 118, 0.3);
}

/* =====================================================
   КНОПКА «СООБЩИТЬ О БАГЕ» В САЙДБАРЕ
   ===================================================== */
.sidebar-item-bug {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  border-radius: 0 0 12px 12px;
}

.sidebar-item-bug::before {
  display: none;
}

.sidebar-item-bug i {
  color: var(--text-muted);
}

.sidebar-item-bug:hover {
  background: var(--header);
  color: var(--text);
  padding-left: 20px;
}

.sidebar-item-bug:hover i {
  color: var(--accent-hover);
  transform: scale(1.1);
}

.sidebar-item-bug:active {
  background: var(--accent);
  color: #FFFFFF;
}

.sidebar-item-bug:active i {
  color: #FFFFFF;
}

/* =====================================================
   КОНТЕНТ
   ===================================================== */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  scroll-behavior: smooth;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabSlideIn 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes tabSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =====================================================
   БЛОКИ
   ===================================================== */
.block {
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
   box-shadow: 0 8px 32px rgba(92, 75, 58, 0.25);
  margin-bottom: 16px;
  transition: box-shadow 0.3s ease;
}

.block:hover {
  box-shadow: 0 8px 24px rgba(92, 75, 58, 0.12);
  border-color: var(--accent);
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.block-header h2 {
  font-family: 'Comfortaa', cursive;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.block-header h2 i {
  color: var(--accent-hover);
  font-size: 20px;
}

/* =====================================================
   ЦЕЛИ
   ===================================================== */
.goals-progress {
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-hover);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.goals-add {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.goals-add input {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border 0.2s ease;
}

.goals-add input::placeholder {
  color: var(--text-muted);
}

.goals-add input:focus {
  border-color: var(--accent);
  background: #FFFDF9;
}

.goals-add button {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.goals-add button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 201, 154, 0.35);
}

.goals-add button:active {
  transform: translateY(0) scale(0.95);
}

.goals-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 4px;
}

.goals-list::-webkit-scrollbar {
  width: 6px;
}

.goals-list::-webkit-scrollbar-track {
  background: transparent;
}

.goals-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.goals-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.goal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.15s ease;
  animation: cardFadeIn 0.35s ease;
}

.goal-item:hover {
  border-color: var(--accent);
}

.goal-item.done .goal-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.goal-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.goal-checkbox:hover {
  transform: scale(1.15);
}

.goal-checkbox:checked {
  animation: checkPulse 0.35s ease;
}

.goal-text {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text);
}

.goal-delete {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-delete:hover {
  background: var(--error);
  color: #FFFFFF;
  transform: rotate(90deg) scale(1.15);
}

/* =====================================================
   ДНИ НЕДЕЛИ
   ===================================================== */
.days-grid {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  cursor: grab;
  user-select: none;
  width: 100%;
}

.days-grid.dragging {
  cursor: grabbing;
}

.days-grid::-webkit-scrollbar {
  height: 8px;
}

.days-grid::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.days-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.days-grid::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.day-card {
  flex: 0 0 220px;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

.day-card {
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 400px;
  animation: cardFadeIn 0.35s ease;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.day-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  opacity: 0.9;
}

.day-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(92, 75, 58, 0.12);
  border-color: var(--accent);
}

.day-header {
  text-align: center;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
  margin-top: 4px;
}

.day-name {
  font-family: 'Comfortaa', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}

.day-date {
  font-family: 'Rubik', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.day-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
}

.day-progress-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress-deg, 0deg), var(--border) var(--progress-deg, 0deg));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-progress-circle::before {
  content: '';
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--block);
}

.day-progress-text {
  position: relative;
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  z-index: 1;
}

.day-tasks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  height: 160px;
  max-height: 160px;
  min-height: 160px;
  padding-right: 4px;
  flex: 0 0 auto;
}

.day-tasks::-webkit-scrollbar {
  width: 4px;
}

.day-tasks::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.day-tasks::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.task-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.task-checkbox:hover {
  transform: scale(1.15);
}

.task-checkbox:checked {
  animation: checkPulse 0.35s ease;
}

.task-text {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  word-break: break-word;
}

.task-delete {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.task-delete:hover {
  background: var(--error);
  color: #FFFFFF;
  transform: rotate(90deg) scale(1.15);
}

.day-add-task {
  display: flex;
  gap: 4px;
}

.day-add-task input {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.day-add-task input:focus {
  border-color: var(--accent);
}

.day-add-task button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.day-add-task button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.day-note {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 40px;
  outline: none;
}

.day-note:focus {
  border-color: var(--accent);
}

/* =====================================================
   ПРИВЫЧКИ (в планере)
   ===================================================== */
.habits-block {
  margin-top: 16px;
}

.habits-summary {
  display: flex;
  gap: 14px;
  align-items: center;
}

#habitsProgress {
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-hover);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

#habitsStars {
  font-size: 16px;
  color: #E8B84B;
  letter-spacing: 2px;
}

.habits-add {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* =====================================================
   ЗАГОЛОВКИ РАЗДЕЛОВ
   ===================================================== */
.analytics-header,
.diary-header,
.archive-header {
  text-align: center;
  margin-bottom: 20px;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.analytics-header h1,
.diary-header h1,
.archive-header h1 {
  font-family: 'Comfortaa', cursive;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.analytics-header h1 i,
.diary-header h1 i,
.archive-header h1 i {
  color: var(--accent-hover);
}

.analytics-subtitle,
.diary-subtitle,
.archive-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
}

/* =====================================================
   АНАЛИТИКА — СЛАЙДЕР
   ===================================================== */
.analytics-slider {
  overflow: hidden;
  border-radius: 20px;
  position: relative;
  cursor: grab;
  user-select: none;
}

.analytics-slider.dragging {
  cursor: grabbing;
}

.slider-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  flex-shrink: 0;
}

.slide-content {
  display: flex;
  gap: 24px;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
  min-height: 420px;
}

.slide-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-main {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  text-align: center;
}

.stat-label {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-family: 'Rubik', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.stat-value.big {
  font-size: 42px;
  color: var(--accent-hover);
  line-height: 1;
  text-shadow: 0 0 20px rgba(168, 201, 154, 0.25);
  transition: text-shadow 0.3s ease;
}

.stat-value.big:hover {
  text-shadow: 0 0 30px rgba(168, 201, 154, 0.5);
}

.stat-value.penalty {
  color: #E88F8F;
}

.stat-row {
  display: flex;
  gap: 12px;
}

.stat-item {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
}

.slide-chart {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  min-width: 300px;
}

.chart-title {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  text-align: center;
}

.chart-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  padding: 8px 0;
  min-height: 240px;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  max-width: 40px;
  background: var(--accent);
  border-radius: 8px 8px 4px 4px;
  transition: height 0.4s ease, background 0.2s ease;
  min-height: 4px;
  position: relative;
}

.chart-bar:hover {
  background: var(--accent-hover);
}

.chart-bar-value {
  font-family: 'Rubik', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.chart-bar-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ===== ТОЧКИ СЛАЙДЕРА ===== */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 8px 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot:hover {
  background: var(--text-muted);
}

.dot.active {
  background: var(--accent);
  transform: scale(1.4);
  box-shadow: 0 0 8px rgba(168, 201, 154, 0.6);
}

/* =====================================================
   ДНЕВНИК
   ===================================================== */
.diary-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diary-card {
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  animation: cardFadeIn 0.35s ease;
}

.diary-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.diary-day-name {
  font-family: 'Comfortaa', cursive;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.diary-day-date {
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
}

.diary-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.diary-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diary-field-label {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.diary-field-label i {
  font-size: 15px;
  color: var(--accent-hover);
}

/* ===== КАСТОМНЫЙ DROPDOWN ===== */
.custom-select {
  position: relative;
  user-select: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--accent);
}

.custom-select-trigger.open {
  border-color: var(--accent);
  background: #FFFDF9;
}

.custom-select-trigger::after {
  content: '▾';
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.custom-select-trigger.open::after {
  transform: rotate(180deg);
}

.custom-select-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(92, 75, 58, 0.15);
  z-index: 50;
  padding: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.custom-select-options.open {
  display: block;
  animation: dropdownSlide 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-select-option {
  padding: 8px 12px;
  border-radius: 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover {
  background: var(--header);
}

.custom-select-option.selected {
  background: var(--accent);
  color: #FFFFFF;
}

.custom-select-option[data-value="Плохой"],
.custom-select-option[data-value="Низкая"],
.custom-select-option[data-value="Плохое"] {
  color: #C97070;
}

.custom-select-option[data-value="Нормальный"],
.custom-select-option[data-value="Средняя"],
.custom-select-option[data-value="Нормальное"] {
  color: #B8935A;
}

.custom-select-option[data-value="Хороший"],
.custom-select-option[data-value="Высокая"],
.custom-select-option[data-value="Хорошее"] {
  color: #6B9B5A;
}

.custom-select-option[data-value="Отличный"],
.custom-select-option[data-value="Отличное"] {
  color: #4A8B3A;
  font-weight: 700;
}

.diary-input {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border 0.2s ease;
}

.diary-input:focus {
  border-color: var(--accent);
  background: #FFFDF9;
}

.diary-textarea {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border 0.2s ease;
  resize: vertical;
  min-height: 80px;
}

.diary-textarea:focus {
  border-color: var(--accent);
  background: #FFFDF9;
}

.diary-row-full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.diary-thoughts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diary-stats-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* =====================================================
   КАЛЕНДАРЬ
   ===================================================== */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.calendar-nav-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.calendar-month-label {
  font-family: 'Comfortaa', cursive;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  min-width: 220px;
  text-align: center;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
}

.calendar-weekdays div {
  text-align: center;
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
}

.calendar-day {
  aspect-ratio: 1;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.calendar-day:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(92, 75, 58, 0.12);
}

.calendar-day.other-month {
  opacity: 0.35;
}

.calendar-day.today {
  border-color: var(--accent);
  border-width: 2px;
  background: var(--bg);
}

.calendar-day-number {
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.calendar-day.today .calendar-day-number {
  color: var(--accent-hover);
  font-weight: 700;
}

.calendar-day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.calendar-event-dot {
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  color: var(--text);
  background: var(--header);
  border-radius: 3px;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 2px solid var(--accent);
}

.calendar-event-dot.done {
  text-decoration: line-through;
  opacity: 0.6;
}

.calendar-event-count {
  font-family: 'Rubik', sans-serif;
  font-size: 9px;
  color: var(--text-muted);
  text-align: right;
}

/* ===== МОДАЛКА КАЛЕНДАРЯ ===== */
.cal-modal-list {
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal-modal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cal-modal-item .cal-modal-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.cal-modal-item .cal-modal-text {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text);
}

.cal-modal-item.done .cal-modal-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.cal-modal-item .cal-modal-del {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.cal-modal-item .cal-modal-del:hover {
  background: var(--error);
  color: #FFFFFF;
}

.cal-modal-add {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.cal-modal-add input {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.cal-modal-add input:focus {
  border-color: var(--accent);
}

.cal-modal-add button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cal-modal-add button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* =====================================================
   ФИНАНСЫ / ПРИВЫЧКИ — ЗАГЛУШКА
   ===================================================== */
.finance-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 16px;
  min-height: 400px;
}

.finance-placeholder > i {
  font-size: 64px;
  color: var(--accent);
  margin-bottom: 16px;
}

.finance-placeholder h2 {
  font-family: 'Comfortaa', cursive;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-placeholder h2 i {
  font-size: 26px;
  color: var(--accent);
}

.finance-placeholder p {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
}

/* =====================================================
   ВКЛАДКИ ВНУТРИ РАЗДЕЛОВ (Привычки, Настройки)
   ===================================================== */
.habits-stats-tabs,
.settings-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.habits-stats-tab,
.settings-tab {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--block);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.habits-stats-tab:hover,
.settings-tab:hover {
  background: var(--header);
  color: var(--text);
  transform: translateY(-1px);
}

.habits-stats-tab.active,
.settings-tab.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent-hover);
}

.habits-stats-content,
.settings-content {
  max-width: 900px;
  margin: 0 auto;
}

/* =====================================================
   МОДАЛЬНЫЕ ОКНА
   ===================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(92, 75, 58, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: overlayFadeIn 0.25s ease;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(92, 75, 58, 0.25);
  animation: modalFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal h3 {
  font-family: 'Comfortaa', cursive;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal h3 i {
  color: var(--accent-hover);
}

.modal p {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
}

.modal-habit-name {
  font-weight: 700;
  color: var(--accent-hover);
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.modal-warning {
  background: #FBEAEA;
  border: 1px solid var(--error);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  color: var(--text);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
}

.modal-cancel,
.modal-confirm {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-cancel {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.modal-cancel:hover {
  background: var(--header);
}

.modal-confirm {
  background: var(--error);
  color: #FFFFFF;
}

.modal-confirm:hover {
  background: #E88F8F;
}

/* =====================================================
   АРХИВЫ
   ===================================================== */
.weeks-list,
.archived-habits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.week-item,
.archived-habit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
}

.week-item:hover,
.archived-habit-item:hover {
  border-color: var(--accent);
  background: var(--bg);
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(92, 75, 58, 0.12);
}

.week-item.current {
  border-color: var(--accent);
  background: var(--bg);
}

.week-item .week-item-date {
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  font-size: 14px;
}

.week-item .week-item-mark {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-hover);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.archived-habit-item {
  cursor: default;
}

.archived-habit-item .habit-archive-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.archived-habit-item .habit-archive-name {
  font-weight: 700;
  font-size: 14px;
}

.archived-habit-item .habit-archive-date {
  font-size: 11px;
  color: var(--text-muted);
}

.restore-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.restore-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 201, 154, 0.35);
}

.empty-archive {
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  padding: 40px 20px;
  background: var(--block);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* =====================================================
   СПРАВКА
   ===================================================== */
.help-container {
  display: flex;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 500px;
}

.help-sidebar {
  flex-shrink: 0;
  width: 240px;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 12px;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.help-sidebar-title {
  font-family: 'Comfortaa', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  padding: 0 8px 12px 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.help-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.help-nav-item {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-nav-item:hover {
  background: var(--header);
  transform: translateX(4px);
}

.help-nav-item.active {
  background: var(--accent);
  color: #FFFFFF;
}

.help-content {
  flex: 1;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  line-height: 1.65;
}

.help-content h1 {
  font-family: 'Comfortaa', cursive;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.help-content h2 {
  font-family: 'Comfortaa', cursive;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.help-content h2:first-child {
  margin-top: 0;
}

.help-content p {
  font-size: 14px;
  margin-bottom: 12px;
}

.help-content ul {
  padding-left: 22px;
  margin-bottom: 14px;
}

.help-content li {
  font-size: 14px;
  margin-bottom: 6px;
}

.help-content b {
  color: var(--text);
  font-weight: 700;
}

.help-content code {
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--text);
}

.help-tip {
  background: #FBF3D5;
  border-left: 4px solid #E8B84B;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 13px;
  color: #5C4B3A;
}

.help-tip b {
  color: #8B6F2A;
}

.help-warning {
  background: #FBEAEA;
  border-left: 4px solid var(--error);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 13px;
  color: #5C4B3A;
}

.help-warning b {
  color: #8B4A4A;
}

.help-green { color: #4A8B3A; font-weight: 700; }
.help-red { color: #C97070; font-weight: 700; }
.help-yellow { color: #B8935A; font-weight: 700; }
.help-blue { color: #3A5A7A; font-weight: 700; }
.help-accent { color: var(--accent-hover); font-weight: 700; }

/* =====================================================
   ПРИВЕТСТВЕННОЕ ОКНО
   ===================================================== */
.welcome-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(92, 75, 58, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.welcome-overlay.open {
  display: flex;
}

.welcome-modal {
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 44px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(92, 75, 58, 0.3);
  text-align: center;
  animation: welcomeFadeIn 0.5s ease;
}

.welcome-icon {
  font-size: 56px;
  margin-bottom: 12px;
  color: var(--accent-hover);
}

.welcome-title {
  font-family: 'Comfortaa', cursive;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.welcome-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  text-align: left;
}

.welcome-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.welcome-feature-icon {
  font-size: 26px;
  flex-shrink: 0;
  color: var(--accent-hover);
  display: flex;
  align-items: center;
}

.welcome-feature-title {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.welcome-feature-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

.welcome-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 32px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
}

.welcome-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(168, 201, 154, 0.35);
}

/* =====================================================
   АККАУНТ
   ===================================================== */
.account-block {
  max-width: 600px;
  margin: 0 auto;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.account-status {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: left;
}

.account-status-in {
  border-color: var(--accent);
  background: rgba(168, 201, 154, 0.08);
}

.account-icon-google {
  font-size: 32px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.account-icon-ok {
  font-size: 32px;
  color: var(--accent-hover);
  flex-shrink: 0;
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.account-title {
  font-family: 'Comfortaa', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.account-email {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-saved {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

.account-description {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
  text-align: left;
}

.account-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.account-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-btn.login {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(168, 201, 154, 0.3);
}

.account-btn.login:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 201, 154, 0.4);
}

.account-btn.login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.account-btn.logout {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.account-btn.logout:hover {
  background: var(--error);
  color: #FFFFFF;
  border-color: var(--error);
}

/* =====================================================
   ТЕМЫ
   ===================================================== */
body.theme-warm {
  --bg: #FDF6EC;
  --block: #F5E6D3;
  --header: #F7D9C4;
  --accent: #A8C99A;
  --accent-hover: #8FBF7F;
  --error: #F5A9A9;
  --text: #5C4B3A;
  --text-muted: #8A7A6A;
  --border: #C9B89A;
  --bg-image: url('assets/bg-warm.png');
}

body.theme-dark {
  --bg: #2A2520;
  --block: #3A322A;
  --header: #4A3F35;
  --accent: #C9A876;
  --accent-hover: #D9B886;
  --error: #D48A8A;
  --text: #F0E6D8;
  --text-muted: #B8A898;
  --border: #5A4E42;
  --bg-image: url('assets/bg-dark.png');
}

body.theme-pink {
  --bg: #FDF0F0;
  --block: #F8DCDC;
  --header: #F5C4C4;
  --accent: #D48A8A;
  --accent-hover: #C47878;
  --error: #E0A0A0;
  --text: #6B3A3A;
  --text-muted: #A87878;
  --border: #D9A9A9;
  --bg-image: url('assets/bg-pink.png');
}

body.theme-blue {
  --bg: #F0F2F8;
  --block: #E0E4F0;
  --header: #D0D6E8;
  --accent: #8A9BC4;
  --accent-hover: #7386B8;
  --error: #D49A9A;
  --text: #3A4258;
  --text-muted: #7A8298;
  --border: #B8BED8;
  --bg-image: url('assets/bg-blue.png');
}

/* =====================================================
   ПЛИТКИ ТЕМ
   ===================================================== */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.theme-tile {
  background: var(--block);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease,
              background-color 0.35s ease;
  box-shadow: var(--shadow);
  text-align: center;
}

.theme-tile:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(92, 75, 58, 0.14);
}

.theme-tile.active {
  border-color: var(--accent);
  border-width: 3px;
  box-shadow: 0 0 0 4px rgba(168, 201, 154, 0.25);
}

.theme-preview {
  display: flex;
  gap: 6px;
  border-radius: 12px;
  overflow: hidden;
  height: 110px;
  margin-bottom: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.theme-preview-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.theme-preview-block {
  flex: 1;
  margin: 4px;
  border-radius: 4px;
}

.theme-preview-content {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
}

.theme-preview-line {
  height: 6px;
  border-radius: 3px;
}

.theme-name {
  font-family: 'Comfortaa', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.theme-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
}

.theme-tile.active .theme-name::after {
  content: ' ✓';
  color: var(--accent);
}

.theme-tile[data-theme="warm"] .theme-preview { background: #FDF6EC; }
.theme-tile[data-theme="warm"] .theme-preview-block { background: #F5E6D3; }
.theme-tile[data-theme="warm"] .theme-preview-line { background: #A8C99A; }
.theme-tile[data-theme="warm"] .theme-preview-line:nth-child(2) { background: #C9B89A; width: 70%; }

.theme-tile[data-theme="dark"] .theme-preview { background: #2A2520; }
.theme-tile[data-theme="dark"] .theme-preview-block { background: #4A3F35; }
.theme-tile[data-theme="dark"] .theme-preview-line { background: #C9A876; }
.theme-tile[data-theme="dark"] .theme-preview-line:nth-child(2) { background: #5A4E42; width: 70%; }

.theme-tile[data-theme="pink"] .theme-preview { background: #FDF0F0; }
.theme-tile[data-theme="pink"] .theme-preview-block { background: #F5C4C4; }
.theme-tile[data-theme="pink"] .theme-preview-line { background: #D48A8A; }
.theme-tile[data-theme="pink"] .theme-preview-line:nth-child(2) { background: #D9A9A9; width: 70%; }

.theme-tile[data-theme="blue"] .theme-preview { background: #F0F2F8; }
.theme-tile[data-theme="blue"] .theme-preview-block { background: #D0D6E8; }
.theme-tile[data-theme="blue"] .theme-preview-line { background: #8A9BC4; }
.theme-tile[data-theme="blue"] .theme-preview-line:nth-child(2) { background: #B8BED8; width: 70%; }

/* =====================================================
   АНИМАЦИИ
   ===================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes checkPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

@keyframes dropdownSlide {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes welcomeFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* =====================================================
   СКРОЛЛБАР
   ===================================================== */
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-track { background: var(--bg); }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
.content::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
/* ===== ДНЕВНИК ===== */
.diary-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diary-card {
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  animation: cardFadeIn 0.35s ease;
}

.diary-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.diary-day-name {
  font-family: 'Comfortaa', cursive;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.diary-day-date {
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
}

.diary-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.diary-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diary-field-label {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.diary-field-label i {
  font-size: 15px;
  color: var(--accent-hover);
}

.diary-row-full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.diary-thoughts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diary-input {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border 0.2s ease;
}

.diary-input:focus {
  border-color: var(--accent);
  background: #FFFDF9;
}

.diary-textarea {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border 0.2s ease;
  resize: vertical;
  min-height: 80px;
}

.diary-textarea:focus {
  border-color: var(--accent);
  background: #FFFDF9;
}

/* Кастомный dropdown */
.custom-select {
  position: relative;
  user-select: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--accent);
}

.custom-select-trigger.open {
  border-color: var(--accent);
  background: #FFFDF9;
}

.custom-select-trigger::after {
  content: '▾';
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.custom-select-trigger.open::after {
  transform: rotate(180deg);
}

.custom-select-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(92, 75, 58, 0.15);
  z-index: 50;
  padding: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.custom-select-options.open {
  display: block;
  animation: dropdownSlide 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-select-option {
  padding: 8px 12px;
  border-radius: 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.custom-select-option:hover {
  background: var(--header);
}

.custom-select-option.selected {
  background: var(--accent);
  color: #FFFFFF;
}

.custom-select-option[data-value="Плохой"],
.custom-select-option[data-value="Низкая"],
.custom-select-option[data-value="Плохое"] {
  color: #C97070;
}

.custom-select-option[data-value="Нормальный"],
.custom-select-option[data-value="Средняя"],
.custom-select-option[data-value="Нормальное"] {
  color: #B8935A;
}

.custom-select-option[data-value="Хороший"],
.custom-select-option[data-value="Высокая"],
.custom-select-option[data-value="Хорошее"] {
  color: #6B9B5A;
}

.custom-select-option[data-value="Отличный"],
.custom-select-option[data-value="Отличное"] {
  color: #4A8B3A;
  font-weight: 700;
}
/* ===== АНАЛИТИКА ПРИВЫЧЕК ===== */
.habits-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.habits-metric {
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
}

.habits-metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(92, 75, 58, 0.12);
}

.habits-metric-icon {
  font-size: 28px;
  color: var(--accent-hover);
  margin-bottom: 8px;
}

.habits-metric-icon.green {
  color: #6B9B5A;
}

.habits-metric-icon.red {
  color: #E88F8F;
}

.habits-metric-icon.accent {
  color: var(--accent-hover);
}

.habits-metric-label {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.habits-metric-value {
  font-family: 'Rubik', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.habits-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 6px;
  min-height: 240px;
  padding: 12px 0;
}

.habits-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.habits-stat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.habits-stat-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.habits-stat-rank {
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.habits-stat-name {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  width: 180px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habits-stat-bar-wrap {
  flex: 1;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.habits-stat-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}

.habits-stat-percent {
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 700;
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .habits-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .habits-stat-name {
    width: 100px;
  }
}
/* ===== ЗАБЛОКИРОВАННЫЕ КНОПКИ НЕДЕЛЬ ===== */
.week-btn:disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.4;
}

/* =====================================================
   ФИНАНСЫ
   ===================================================== */

/* ===== ОБЩИЙ СЛАЙД ===== */
.slide-content.finance-overview,
.slide-content.finance-month,
.slide-content.finance-categories {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

/* ===== НАВИГАЦИЯ ПО ГОДАМ / МЕСЯЦАМ ===== */
.finance-year-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 4px;
}

.finance-nav-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s ease;
}

.finance-nav-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.finance-nav-btn:active {
  transform: scale(0.94);
}

.finance-year-label {
  font-family: 'Comfortaa', cursive;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  min-width: 160px;
  text-align: center;
}

/* ===== 4 ПЛИТКИ ===== */
.finance-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.finance-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finance-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 5px 14px rgba(92, 75, 58, 0.10);
}

.finance-tile-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.finance-tile-value {
  font-family: 'Rubik', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.finance-tile-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
}

.finance-tile-sub span {
  font-weight: 700;
  color: var(--text);
}

.finance-tile-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.finance-tile-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.6s ease, background 0.3s ease;
}

/* ===== БЛОКИ ГРАФИКОВ ===== */
.finance-chart-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.finance-chart-block .chart-title {
  margin-bottom: 14px;
}

/* ===== BAR-CHART ПО МЕСЯЦАМ ===== */
.finance-month-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-height: 220px;
  padding: 8px 0 0 0;
}

.finance-month-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.finance-month-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.finance-month-bar {
  flex: 1;
  max-width: 10px;
  border-radius: 4px 4px 2px 2px;
  min-height: 2px;
  transition: height 0.5s ease;
}

.finance-month-bar.income {
  background: #8FBF7F;
}

.finance-month-bar.expense {
  background: #E88F8F;
}

.finance-month-bar.saving {
  background: #8A9BC4;
}

.finance-month-label {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.finance-chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.income { background: #8FBF7F; }
.legend-dot.expense { background: #E88F8F; }
.legend-dot.saving { background: #8A9BC4; }

/* ===== DONUT ПО КАТЕГОРИЯМ ===== */
.finance-donut-wrap {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 10px 0;
}

.finance-donut {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  position: relative;
  transition: background 0.6s ease;
  box-shadow: inset 0 0 0 1px var(--border);
}

.finance-donut::after {
  content: '';
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}

.finance-donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.finance-donut-legend::-webkit-scrollbar {
  width: 5px;
}

.finance-donut-legend::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.finance-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.finance-legend-row:hover {
  background: var(--block);
}

.finance-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.finance-legend-name {
  flex: 1;
  font-weight: 600;
}

.finance-legend-percent {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 48px;
  text-align: right;
}

/* ===== КНОПКА ДОБАВИТЬ ОПЕРАЦИЮ ===== */
.finance-add-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 22px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  align-self: center;
  box-shadow: 0 4px 12px rgba(168, 201, 154, 0.3);
}

.finance-add-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(168, 201, 154, 0.4);
}

.finance-add-btn:active {
  transform: translateY(0) scale(0.97);
}

.finance-add-btn.small {
  padding: 8px 16px;
  font-size: 13px;
  align-self: auto;
}

/* ===== 5 ТАБЛИЦ МЕСЯЦА ===== */
.finance-tables {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.finance-table-block {
  grid-column: span 2;
}

.finance-table-block:nth-child(4),
.finance-table-block:nth-child(5) {
  grid-column: span 3;
}

.finance-table-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

.finance-table-block.wide {
  grid-column: 1 / -1;
}

.finance-table-title {
  font-family: 'Comfortaa', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.finance-table-title i {
  color: var(--accent-hover);
  font-size: 17px;
}

.finance-table-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.finance-table-list::-webkit-scrollbar {
  width: 5px;
}

.finance-table-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.finance-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--block);
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  transition: all 0.15s ease;
}

.finance-row:hover {
  border-color: var(--accent);
}

.finance-row-date {
  font-family: 'Rubik', sans-serif;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 38px;
}

.finance-row-cat {
  flex: 1;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-row-amount {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
  min-width: 80px;
  text-align: right;
}

.finance-row-amount.income { color: #6B9B5A; }
.finance-row-amount.expense { color: #C97070; }
.finance-row-amount.saving { color: #5A7AA8; }
.finance-row-amount.debt { color: #B8935A; }

.finance-row-del {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.finance-row-del:hover {
  background: var(--error);
  color: #FFFFFF;
  transform: rotate(90deg) scale(1.1);
}

.finance-table-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.finance-empty {
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  padding: 20px 10px;
  font-style: italic;
}

/* ===== СТАТЬИ ===== */
.finance-categories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.finance-categories-header h2 {
  font-family: 'Comfortaa', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.finance-categories-header h2 i {
  color: var(--accent-hover);
}

.finance-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.finance-cat-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.finance-cat-group-title {
  font-family: 'Comfortaa', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-cat-group-title i {
  color: var(--accent-hover);
}

.finance-cat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finance-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--block);
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s ease;
}

.finance-cat-item:hover {
  border-color: var(--accent);
}

.finance-cat-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.finance-cat-name {
  flex: 1;
  font-weight: 600;
}

.finance-cat-del {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s ease;
}

.finance-cat-del:hover {
  background: var(--error);
  color: #FFFFFF;
  transform: rotate(90deg) scale(1.1);
}

/* ===== МОДАЛКА ДОБАВЛЕНИЯ ОПЕРАЦИИ ===== */
.finance-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.finance-modal-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finance-modal-label {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.finance-modal-input,
.finance-modal-select {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border 0.2s ease;
}

.finance-modal-input:focus,
.finance-modal-select:focus {
  border-color: var(--accent);
  background: #FFFDF9;
}

.finance-type-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.finance-type-tab {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.finance-type-tab:hover {
  background: var(--header);
  color: var(--text);
}

.finance-type-tab.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent-hover);
}

/* ===== АДАПТИВ ===== */
@media (max-width: 900px) {
  .finance-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .finance-tables {
    grid-template-columns: 1fr;
  }
  .finance-categories-grid {
    grid-template-columns: 1fr;
  }
  .finance-donut-wrap {
    flex-direction: column;
  }
  .finance-donut {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 600px) {
  .finance-tiles {
    grid-template-columns: 1fr;
  }
}

/* ===== КАСТОМНАЯ ПАЛИТРА ===== */
.finance-color-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finance-color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.finance-color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}

.finance-color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.finance-color-swatch.selected {
  border-color: var(--text);
  transform: scale(1.08);
  box-shadow: 0 0 0 3px var(--accent);
}

.finance-color-recent-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.finance-color-recent {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.finance-color-recent .finance-color-swatch {
  width: 28px;
  height: 28px;
  aspect-ratio: auto;
}
.finance-nav-btn:disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.4;
}

.finance-plan-edit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
  margin-left: 4px;
  transition: all 0.15s ease;
}

.finance-plan-edit:hover {
  color: var(--accent-hover);
  transform: scale(1.2);
}

/* ===== TOAST-УВЕДОМЛЕНИЯ ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--block);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 8px 24px rgba(92, 75, 58, 0.18);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 340px;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.hide {
  animation: toastOut 0.25s ease forwards;
}

.toast i {
  font-size: 18px;
  flex-shrink: 0;
}

.toast.error {
  border-left-color: #E88F8F;
}

.toast.error i {
  color: #C97070;
}

.toast.success {
  border-left-color: #6B9B5A;
}

.toast.success i {
  color: #6B9B5A;
}

.toast.warning {
  border-left-color: #E8B84B;
}

.toast.warning i {
  color: #B8935A;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ===== ГЛОБАЛЬНЫЕ ПЛАВНЫЕ ПЕРЕХОДЫ ЦВЕТОВ ===== */
.block,
.topbar,
.sidebar,
.day-card,
.goal-item,
.task-item,
.habits-table tbody tr,
.diary-card,
.calendar-day,
.finance-tile,
.finance-chart-block,
.finance-table-block,
.finance-cat-group,
.modal,
.week-dropdown,
.theme-tile,
.stat-item,
.stat-main,
.slide-chart,
.slide-content {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.3s ease;
}

/* ===== PRESS-ЭФФЕКТ ДЛЯ КНОПОК ===== */
.goals-add button:active,
.habits-add button:active,
.day-add-task button:active,
.finance-add-btn:active,
.welcome-btn:active,
.restore-btn:active,
.cal-modal-add button:active,
.calendar-nav-btn:active,
.week-btn:active,
.menu-btn:active,
.sidebar-item:active,
.modal-cancel:active,
.modal-confirm:active,
.finance-nav-btn:active,
.finance-type-tab:active,
.habits-stats-tab:active,
.settings-tab:active,
.theme-tile:active {
  transform: scale(0.95);
  transition: transform 0.08s ease;
}

/* ===== ЦВЕТОВАЯ ВСПЫШКА НА ЧЕКБОКСАХ ===== */
.goal-checkbox,
.task-checkbox,
.habit-check,
.cal-modal-checkbox {
  transition: transform 0.15s ease, box-shadow 0.25s ease;
  border-radius: 4px;
}

.goal-checkbox:checked,
.task-checkbox:checked,
.habit-check:checked,
.cal-modal-checkbox:checked {
  box-shadow: 0 0 0 4px rgba(168, 201, 154, 0.25);
}

body.theme-pink .goal-checkbox:checked,
body.theme-pink .task-checkbox:checked,
body.theme-pink .habit-check:checked,
body.theme-pink .cal-modal-checkbox:checked {
  box-shadow: 0 0 0 4px rgba(212, 138, 138, 0.25);
}

body.theme-blue .goal-checkbox:checked,
body.theme-blue .task-checkbox:checked,
body.theme-blue .habit-check:checked,
body.theme-blue .cal-modal-checkbox:checked {
  box-shadow: 0 0 0 4px rgba(138, 155, 196, 0.25);
}

body.theme-dark .goal-checkbox:checked,
body.theme-dark .task-checkbox:checked,
body.theme-dark .habit-check:checked,
body.theme-dark .cal-modal-checkbox:checked {
  box-shadow: 0 0 0 4px rgba(201, 168, 118, 0.35);
}

/* ===== КАСКАДНОЕ ПОЯВЛЕНИЕ КАРТОЧЕК ДНЕЙ ===== */
.days-grid .day-card:nth-child(1) { animation-delay: 0.00s; }
.days-grid .day-card:nth-child(2) { animation-delay: 0.05s; }
.days-grid .day-card:nth-child(3) { animation-delay: 0.10s; }
.days-grid .day-card:nth-child(4) { animation-delay: 0.15s; }
.days-grid .day-card:nth-child(5) { animation-delay: 0.20s; }
.days-grid .day-card:nth-child(6) { animation-delay: 0.25s; }
.days-grid .day-card:nth-child(7) { animation-delay: 0.30s; }

/* ===== ЗАЩИТА ОТ ДВОЕНИЯ ТЕКСТА НА BUTTON ===== */
button {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.sidebar-item,
.week-dropdown-item,
.custom-select-option,
.habits-stats-tab,
.settings-tab,
.finance-type-tab {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* ===== СИНХРОНИЗАЦИЯ — СТАТУС ===== */
.sync-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  text-align: left;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.sync-status-card:hover {
  border-color: var(--accent);
}

.account-icon-sync {
  font-size: 28px;
  color: var(--accent-hover);
  flex-shrink: 0;
}

.sync-status-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sync-status-title {
  font-family: 'Comfortaa', cursive;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.sync-status-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== КНОПКИ СИНХРОНИЗАЦИИ ===== */
.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.account-btn.sync {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(168, 201, 154, 0.3);
}

.account-btn.sync:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.account-btn.upload,
.account-btn.download {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.account-btn.upload:hover,
.account-btn.download:hover {
  background: var(--header);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.account-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== ОВЕРЛЕЙ ПЕРЕЗАПУСКА ===== */
.app-reloading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(92, 75, 58, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  animation: overlayFadeIn 0.3s ease;
}

.app-reloading-overlay.open {
  display: flex;
}

.app-reloading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 60px;
  box-shadow: 0 20px 60px rgba(92, 75, 58, 0.35);
  animation: welcomeFadeIn 0.4s ease;
}

.app-reloading-spinner {
  font-size: 48px;
  color: var(--accent-hover);
  animation: reloadSpin 1.2s linear infinite;
}

@keyframes reloadSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.app-reloading-text {
  font-family: 'Comfortaa', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

/* ===== БАННЕР СИНХРОНИЗАЦИИ ===== */
.sync-banner {
  background: linear-gradient(90deg, rgba(168, 201, 154, 0.15) 0%, rgba(168, 201, 154, 0.08) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0 24px;
}

.sync-banner.open {
  max-height: 120px;
  opacity: 1;
  padding: 12px 24px;
}

.sync-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
}

.sync-banner-icon {
  font-size: 26px;
  color: var(--accent-hover);
  flex-shrink: 0;
  animation: syncBannerPulse 2s ease-in-out infinite;
}

@keyframes syncBannerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.sync-banner-text {
  flex: 1;
  min-width: 0;
}

.sync-banner-title {
  font-family: 'Comfortaa', cursive;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.sync-banner-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

.sync-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.sync-banner-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sync-banner-btn:hover {
  background: var(--header);
  border-color: var(--accent);
}

.sync-banner-btn.primary {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

.sync-banner-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 201, 154, 0.3);
}

.sync-banner-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Адаптив для мобильных */
@media (max-width: 700px) {
  .sync-banner-content {
    flex-wrap: wrap;
  }
  .sync-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ===== ЗАГОЛОВОК ГРУППЫ В АРХИВЕ НЕДЕЛЬ ===== */
.archive-group-title {
  font-family: 'Comfortaa', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 10px;
  margin-top: 20px;
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

.archive-group {
  margin-bottom: 24px;
}

.archive-group:first-child .archive-group-title {
  margin-top: 0;
}

@media (max-width: 500px) {
  .finance-type-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== ФИКС: псевдоэлементы иконок не должны ловить клики ===== */
.finance-row-del i,
.finance-row-del i::before,
.finance-row-del i::after,
.finance-cat-del i,
.finance-cat-del i::before,
.finance-cat-del i::after,
.goal-delete i,
.goal-delete i::before,
.goal-delete i::after,
.task-delete i,
.task-delete i::before,
.task-delete i::after,
.habit-delete i,
.habit-delete i::before,
.habit-delete i::after,
.cal-modal-del i,
.cal-modal-del i::before,
.cal-modal-del i::after {
  pointer-events: none !important;
}

/* ===== КНОПКИ ФИНАНСОВ СВЕРХУ ===== */
.finance-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  padding: 0 24px;
}

.finance-tab {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--block);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

.finance-tab:hover {
  background: var(--header);
  color: var(--text);
  transform: translateY(-1px);
}

.finance-tab.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent-hover);
}

/* ===== ГРАФИК МЕСЯЦА (3 столбца) ===== */
/* ===== ГРАФИК МЕСЯЦА (столбы + легенда) ===== */
.finance-month-chart-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  gap: 24px;
  align-items: stretch;
  height: 240px;
  box-sizing: border-box;
}

/* Столбы — слева */
.finance-month-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  min-height: 0;
  padding: 0;
}

.finance-month-group {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  width: 80px;
  height: 100%;
}

.finance-month-bar-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 160px;
  min-height: 160px;
  max-height: 160px;
}

.finance-month-bar {
  width: 60px;
  max-width: 60px;
  border-radius: 10px 10px 4px 4px;
  min-height: 4px;
  height: 0;
  animation: barGrow 0.7s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes barGrow {
  from {
    transform: scaleY(0);
    transform-origin: bottom;
    opacity: 0.4;
  }
  to {
    transform: scaleY(1);
    transform-origin: bottom;
    opacity: 1;
  }
}

.finance-month-label {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

/* Легенда — справа */
.finance-month-legend {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.finance-month-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.finance-month-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.finance-month-legend-name {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.finance-month-legend-value {
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* ===== КНОПКА "+" В ЗАГОЛОВКЕ ТАБЛИЦЫ ФИНАНСОВ ===== */
.finance-table-add-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.finance-table-add-btn i {
  font-size: 14px;
  color: #FFFFFF;
}

.finance-table-add-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.finance-table-add-btn:active {
  transform: scale(0.95);
}

/* =====================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ — БАЗА
   ===================================================== */

@media (max-width: 600px) {
  body {
    overflow-x: hidden;
  }

  .content {
    padding: 12px;
    /* чтобы контент не залезал под нативную полосу */
    padding-top: 12px;
  }

  .topbar {
    padding: 6px 12px;
    height: 52px; /* крупнее под палец */
    gap: 8px;
  }

  .logo {
    font-size: 16px;
  }

  .logo i {
    font-size: 18px;
  }

  .week-switcher {
    margin-right: 0;
    gap: 4px;
  }

  .week-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .week-label {
    font-size: 11px;
    padding: 6px 10px;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .block-header h2 {
    font-size: 16px;
  }

  .archive-header h1,
  .analytics-header h1,
  .diary-header h1 {
    font-size: 20px;
  }

  .archive-subtitle,
  .analytics-subtitle,
  .diary-subtitle {
    font-size: 12px;
  }
}

/* =====================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ — LoopWeek
   Добавлено для мобильных (< 600px) и планшетов (< 900px)
   ===================================================== */

/* =====================================================
   ПЛАНЕР — ТАБЫ
   Глобально: скрыты на десктопе
   ===================================================== */
.planner-tabs {
  display: none;
}

.planner-section {
  display: block;
}

/* =====================================================
   ПРИВЫЧКИ — КАРТОЧКИ
   Глобально: скрыты на десктопе
   ===================================================== */
.habits-cards {
  display: none;
}

/* =====================================================
   МОДАЛКА ВВОДА
   Общие стили (десктоп + мобильный)
   ===================================================== */
.input-modal-input {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  margin-bottom: 16px;
  box-sizing: border-box;
  min-height: 46px;
}

.input-modal-input:focus {
  border-color: var(--accent);
  background: #FFFDF9;
}

/* =====================================================
   ПЛАНШЕТ — 900px
   ===================================================== */
@media (max-width: 900px) {
  .content {
    padding: 20px;
  }

  .block {
    padding: 20px;
    border-radius: 16px;
  }

  .slide-content {
    flex-direction: column;
    padding: 24px;
    gap: 20px;
  }

  .slide-chart {
    min-width: 0;
  }

  .chart-bars {
    min-height: 180px;
  }

  .finance-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .finance-tables {
    grid-template-columns: 1fr;
  }

  .finance-table-block,
  .finance-table-block:nth-child(4),
  .finance-table-block:nth-child(5) {
    grid-column: 1 / -1;
  }

  .finance-categories-grid {
    grid-template-columns: 1fr;
  }

  .finance-donut-wrap {
    flex-direction: column;
    align-items: center;
  }

  .finance-donut {
    width: 160px;
    height: 160px;
  }

  .finance-month-chart-block {
    flex-direction: column;
    height: auto;
  }

  .finance-month-legend {
    width: 100%;
  }

  .habits-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .habits-stat-name {
    width: 100px;
  }

  .help-container {
    flex-direction: column;
  }

  .help-sidebar {
    width: 100%;
    position: static;
  }

  .help-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .days-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
    gap: 12px;
    cursor: default;
    user-select: auto;
  }

  .day-card {
    flex: none;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 300px;
  }

  /* Тач-таргеты и модалки для планшета */
  .week-btn,
  .calendar-nav-btn,
  .finance-nav-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .goals-add button,
  .habits-add button,
  .finance-add-btn {
    min-height: 44px;
  }

  .modal {
    max-width: 90%;
    padding: 24px;
  }

  /* График «Статистика по месяцам» — горизонтальный скролл на планшете */
  .finance-month-chart {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .finance-month-chart .finance-month-group {
    flex: 0 0 auto;
    min-width: 48px;
    scroll-snap-align: start;
  }

  .finance-month-chart::-webkit-scrollbar {
    display: none;
  }

  .finance-chart-block {
    overflow: hidden;
    width: 100%;
  }

  /* ===== СТРУКТУРА СТРАНИЦЫ НА ПЛАНШЕТЕ ===== */
  .planner-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 8px;
    background: var(--block);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: sticky;
    top: 4px;
    z-index: 400;
    box-shadow: 0 2px 8px rgba(92, 75, 58, 0.06);
  }

  .planner-tab {
    flex: 1;
    padding: 10px 4px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
  }

  .planner-tab.active {
    background: var(--accent);
    color: #FFFFFF;
  }

  .planner-section {
    display: none;
  }

  .planner-section.active {
    display: block;
  }

  .habits-table-wrap {
    display: none;
  }

  .habits-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .habit-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .habit-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .habit-card-name {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .habit-card-progress {
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-hover);
    flex-shrink: 0;
  }

  .habit-card-delete {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
  }

  .habit-card-delete:active {
    background: var(--error);
    color: #FFFFFF;
  }

  .habit-card-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }

  .habit-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }

  .habit-day-label {
    font-family: 'Rubik', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
  }

  .habit-card-check {
    width: 100%;
    max-width: 32px;
    aspect-ratio: 1;
    border-radius: 6px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0 auto;
    display: block;
  }

  .habit-card-check:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }

  /* Инлайн-инпуты скрыты — на планшете добавление через модалку */
  .goals-add input,
  .day-add-task input,
  .habits-add input {
    display: none;
  }

  /* На планшете нет нативных кнопок окна — убираем зарезервированный отступ */
  .week-switcher {
    margin-right: 0;
  }

  /* На планшете drag-зона топбара не нужна и перебивает no-drag кнопок */
  .topbar {
    -webkit-app-region: no-drag;
  }

  /* Заголовки таблиц финансов: «+» прижат к правому краю */
  .finance-table-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .finance-table-add-btn {
    margin-left: auto;
    flex-shrink: 0;
  }
}

/* =====================================================
   МОБИЛЬНЫЙ — 600px
   ===================================================== */
@media (max-width: 600px) {

  /* ===== БАЗА ===== */
  body {
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
  }

  .content {
    padding: 8px 10px 16px;
    -webkit-overflow-scrolling: touch;
  }

  /* ===== ТОПБАР ===== */
  .topbar {
    padding: 6px 10px;
    height: 52px;
    gap: 6px;
  }

  .logo {
    display: none;
  }

  .menu-btn {
    width: 42px;
    height: 42px;
    font-size: 20px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .week-switcher {
    margin-right: 0;
    margin-left: auto;
    gap: 4px;
    flex: 1;
    justify-content: flex-end;
  }

  .week-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .week-label {
    font-size: 12px;
    padding: 8px 10px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ===== САЙДБАР ===== */
  .sidebar {
    width: 85vw;
    max-width: 320px;
  }

  .sidebar-header {
    padding: 16px 16px 12px;
    padding-top: 52px;
  }

  .sidebar-logo {
    font-size: 16px;
  }

  .sidebar-nav {
    padding: 12px 8px;
  }

  .sidebar-item {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 12px;
    min-height: 46px;
  }

  .sidebar-item i {
    font-size: 20px;
  }

  .sidebar-close {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  /* ===== ТАБЫ ПЛАНЕРА ===== */
  .planner-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 8px;
    background: var(--block);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: sticky;
    top: 4px;
    z-index: 400;
    box-shadow: 0 2px 8px rgba(92, 75, 58, 0.06);
  }

  .planner-tab {
    flex: 1;
    padding: 10px 4px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    min-height: 40px;
  }

  .planner-tab.active {
    background: var(--accent);
    color: #FFFFFF;
  }

  .planner-section {
    display: none;
  }

  .planner-section.active {
    display: block;
  }

  /* ===== БЛОКИ ===== */
  .block {
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 8px;
  }

  .block-header {
    margin-bottom: 10px;
    gap: 6px;
  }

  .block-header h2 {
    font-size: 15px;
    gap: 6px;
  }

  .block-header h2 i {
    font-size: 17px;
  }

  /* ===== ЦЕЛИ ===== */
  .goals-progress {
    font-size: 12px;
    padding: 3px 8px;
  }

  .goals-add {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
  }

  .goals-add input {
    display: none;
  }

  .goals-add button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    gap: 0;
    flex-shrink: 0;
  }

  .goals-add button i {
    font-size: 20px;
    color: #FFFFFF;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .goals-list {
    max-height: none;
    gap: 6px;
  }

  .goal-item {
    padding: 10px 12px;
    gap: 10px;
    min-height: 46px;
    border-radius: 10px;
  }

  .goal-checkbox {
    width: 22px;
    height: 22px;
  }

  .goal-text {
    font-size: 14px;
  }

  .goal-delete {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  /* ===== ДНИ — ГОРИЗОНТАЛЬНЫЙ СВАЙП ===== */
  .days-grid {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px 10px 14px;
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
    cursor: default;
    user-select: auto;
  }

  .days-grid::-webkit-scrollbar {
    display: none;
  }

  .day-card {
    flex: 0 0 calc(100vw - 32px);
    width: calc(100vw - 32px);
    min-width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    min-height: auto;
    padding: 14px;
    border-radius: 16px;
    gap: 10px;
  }

  .day-header {
    padding-bottom: 8px;
    margin-top: 4px;
  }

  .day-name {
    font-size: 17px;
  }

  .day-date {
    font-size: 12px;
  }

  .day-progress {
    margin: 6px 0;
  }

  .day-progress-circle {
    width: 80px;
    height: 80px;
  }

  .day-progress-circle::before {
    width: 60px;
    height: 60px;
  }

  .day-progress-text {
    font-size: 15px;
  }

  .day-card:hover {
    transform: none;
    box-shadow: var(--shadow);
    border-color: var(--border);
  }

  .day-header {
    padding-bottom: 6px;
  }

  .day-name {
    font-size: 15px;
  }

  .day-date {
    font-size: 11px;
  }

  .day-progress {
    margin: 4px 0;
  }

  .day-progress-circle {
    width: 72px;
    height: 72px;
  }

  .day-progress-circle::before {
    width: 54px;
    height: 54px;
  }

  .day-progress-text {
    font-size: 14px;
  }

  .day-tasks {
    height: auto;
    max-height: 200px;
    min-height: 50px;
    padding: 4px 2px 4px 0;
    gap: 6px;
  }

  .task-item {
    padding: 8px 10px;
    gap: 8px;
    font-size: 13px;
    min-height: 40px;
    border-radius: 8px;
  }

  .task-checkbox {
    width: 20px;
    height: 20px;
  }

  .task-text {
    font-size: 13px;
  }

  .task-delete {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .day-add-task {
    gap: 6px;
  }

  .day-add-task input {
    display: none;
  }

  .day-add-task button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .day-add-task button i {
    font-size: 20px;
    color: #FFFFFF;
  }

  .day-note {
    font-size: 13px;
    padding: 8px 10px;
    min-height: 50px;
    border-radius: 10px;
    resize: none;
  }

  /* ===== ПРИВЫЧКИ — ТАБЛИЦА СКРЫТА, КАРТОЧКИ ===== */
  .habits-summary {
    gap: 6px;
  }

  #habitsProgress {
    font-size: 13px;
    padding: 3px 8px;
  }

  #habitsStars {
    display: none;
  }

  .habits-add {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
  }

  .habits-add input {
    display: none;
  }

  .habits-add button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    gap: 0;
    flex-shrink: 0;
  }

  .habits-add button i {
    font-size: 20px;
    color: #FFFFFF;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .habits-table-wrap {
    display: none;
  }

  .habits-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .habit-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .habit-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .habit-card-name {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .habit-card-progress {
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-hover);
    flex-shrink: 0;
  }

  .habit-card-delete {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
  }

  .habit-card-delete:active {
    background: var(--error);
    color: #FFFFFF;
  }

  .habit-card-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }

  .habit-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }

  .habit-day-label {
    font-family: 'Rubik', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
  }

  .habit-card-check {
    width: 100%;
    max-width: 32px;
    aspect-ratio: 1;
    border-radius: 6px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0 auto;
    display: block;
  }

  .habit-card-check:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }

  /* Штраф */
  .penalty-info {
    font-size: 12px;
    padding: 8px 10px;
    gap: 6px;
    border-radius: 10px;
  }

  .penalty-info i {
    font-size: 16px;
  }

  /* ===== ЗАГОЛОВКИ РАЗДЕЛОВ ===== */
  .archive-header,
  .analytics-header,
  .diary-header {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 14px;
  }

  .archive-header h1,
  .analytics-header h1,
  .diary-header h1 {
    font-size: 18px;
    gap: 8px;
  }

  .archive-header h1 i,
  .analytics-header h1 i,
  .diary-header h1 i {
    font-size: 20px;
  }

  .archive-subtitle,
  .analytics-subtitle,
  .diary-subtitle {
    font-size: 12px;
  }

  /* ===== ДНЕВНИК ===== */
  .diary-list {
    gap: 10px;
  }

  .diary-card {
    padding: 12px;
    border-radius: 14px;
  }

  .diary-card-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    gap: 8px;
  }

  .diary-day-name {
    font-size: 15px;
  }

  .diary-day-date {
    font-size: 12px;
  }

  .diary-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }

  .diary-row-full {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .diary-field {
    gap: 4px;
    min-width: 0;
  }

  .diary-field-label {
    font-size: 10px;
    gap: 3px;
    letter-spacing: 0.2px;
    margin-bottom: 0;
  }

  .diary-field-label i {
    font-size: 12px;
  }

  .custom-select-trigger {
    padding: 8px 10px;
    font-size: 12px;
    min-height: 40px;
    border-radius: 10px;
  }

  .custom-select-trigger::after {
    font-size: 10px;
    margin-left: 4px;
  }

  .diary-input {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 42px;
    border-radius: 10px;
  }

  .diary-textarea {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 70px;
    border-radius: 10px;
  }

  .diary-thoughts {
    gap: 4px;
  }

  .diary-stats-row {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
  }

  .diary-stats-row .stat-item {
    padding: 6px 4px;
  }

  .diary-stats-row .stat-label {
    font-size: 9px;
  }

  .diary-stats-row .stat-value {
    font-size: 12px;
  }

  /* ===== КАЛЕНДАРЬ ===== */
  .calendar-nav {
    gap: 10px;
    margin-bottom: 10px;
  }

  .calendar-nav-btn {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .calendar-month-label {
    font-size: 17px;
    min-width: 0;
  }

  .calendar-weekdays {
    gap: 3px;
    margin-bottom: 6px;
    padding: 4px;
    border-radius: 10px;
  }

  .calendar-weekdays div {
    font-size: 11px;
    padding: 6px 0;
    letter-spacing: 0.5px;
  }

  .calendar-day {
    aspect-ratio: auto;
    min-height: 48px;
    max-height: 48px;
    height: 48px;
    padding: 2px 3px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    gap: 1px;
  }

  .calendar-day-number {
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .calendar-day-events {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    gap: 1px;
  }

  .calendar-event-dot {
    font-size: 7px;
    padding: 0 2px;
    line-height: 1.15;
    border-left-width: 1px;
    border-radius: 2px;
  }

  .calendar-event-count {
    font-size: 7px;
  }

  /* ===== ПРИВЫЧКИ — СТАТИСТИКА ===== */
  .habits-stats-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 10px;
    padding: 0;
    overflow: visible;
    justify-content: stretch;
  }

  .habits-stats-tab {
    padding: 10px 4px;
    font-size: 12px;
    min-height: 40px;
    gap: 4px;
    justify-content: center;
    text-align: center;
    flex: none;
    min-width: 0;
  }

  .habits-stats-tab i {
    font-size: 14px;
  }

  .habits-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 10px;
  }

  .habits-metric {
    padding: 10px 6px;
    border-radius: 12px;
  }

  .habits-metric-icon {
    font-size: 18px;
    margin-bottom: 2px;
  }

  .habits-metric-label {
    font-size: 9px;
    margin-bottom: 2px;
    letter-spacing: 0.2px;
  }

  .habits-metric-value {
    font-size: 18px;
  }

  .habits-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 3px;
    min-height: 140px;
    padding: 6px 0;
    overflow-x: auto;
  }

  .habits-chart .chart-bar-wrap {
    flex: 1 1 auto;
    min-width: 20px;
    max-width: 40px;
  }

  .habits-chart .chart-bar {
    width: 100%;
    max-width: 26px;
  }

  .habits-chart .chart-bar-label {
    font-size: 9px;
    white-space: nowrap;
  }

  .habits-chart .chart-bar-value {
    font-size: 9px;
  }

  .habits-stats-list {
    gap: 6px;
  }

  .habits-stat-item {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
    border-radius: 10px;
  }

  .habits-stat-name {
    width: 100%;
    order: -1;
    font-size: 12px;
    margin-bottom: 2px;
  }

  .habits-stat-rank {
    font-size: 12px;
    width: 20px;
  }

  .habits-stat-percent {
    font-size: 12px;
    min-width: 40px;
  }

  .habits-stat-bar-wrap {
    height: 8px;
  }

  /* ===== АНАЛИТИКА ===== */
  .slide-content {
    padding: 12px;
    border-radius: 14px;
    gap: 10px;
    min-height: auto;
  }

  .slide-stats {
    gap: 8px;
  }

  .stat-main {
    padding: 10px;
    border-radius: 10px;
  }

  .stat-value.big {
    font-size: 32px;
  }

  .stat-value {
    font-size: 14px;
  }

  .stat-label {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .stat-row {
    flex-direction: column;
    gap: 6px;
  }

  .stat-item {
    padding: 8px 10px;
    border-radius: 10px;
  }

  .slide-chart {
    padding: 10px;
    border-radius: 10px;
    min-width: 0;
  }

  .chart-title {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .chart-bars {
    min-height: 130px;
    gap: 3px;
    padding: 4px 0;
  }

  .chart-bar {
    max-width: 26px;
  }

  .chart-bar-value,
  .chart-bar-label {
    font-size: 9px;
  }

  .slider-dots {
    margin-top: 8px;
    gap: 8px;
  }

  .dot {
    width: 11px;
    height: 11px;
  }

  /* ===== ФИНАНСЫ ===== */
  .slide-content.finance-overview,
  .slide-content.finance-month,
  .slide-content.finance-categories {
    padding: 12px;
    gap: 12px;
  }

  .finance-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 10px;
    padding: 0;
    justify-content: stretch;
  }

  .finance-tab {
    padding: 10px 4px;
    font-size: 12px;
    min-height: 40px;
    flex: none;
    min-width: 0;
  }

  .finance-year-nav {
    gap: 8px;
  }

  .finance-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }

  .finance-year-label {
    font-size: 16px;
    min-width: 120px;
  }

  .finance-tiles {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .finance-tile {
    padding: 10px 12px;
    border-radius: 10px;
    gap: 4px;
  }

  .finance-tile-label {
    font-size: 10px;
    letter-spacing: 0.2px;
  }

  .finance-tile-value {
    font-size: 17px;
  }

  .finance-tile-sub {
    font-size: 10px;
  }

  .finance-tile-bar {
    height: 5px;
    margin-top: 2px;
  }

  .finance-chart-block {
    padding: 12px;
    border-radius: 10px;
  }

  .finance-month-chart {
    min-height: 140px;
    gap: 4px;
    padding: 4px 0 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .finance-month-chart::-webkit-scrollbar {
    display: none;
  }

  .finance-month-chart .finance-month-group {
    flex: 0 0 auto;
    min-width: 44px;
    scroll-snap-align: start;
  }

  .finance-month-chart .finance-month-bar {
    max-width: 8px;
    min-height: 2px;
  }

  .finance-month-label {
    font-size: 9px;
  }

  .finance-chart-legend {
    gap: 8px;
    font-size: 10px;
    margin-top: 8px;
  }

  .legend-dot {
    width: 8px;
    height: 8px;
  }

  .finance-donut-wrap {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
  }

  .finance-donut {
    width: 140px;
    height: 140px;
  }

  .finance-donut-legend {
    width: 100%;
    max-height: none;
  }

  .finance-legend-row {
    font-size: 12px;
    padding: 4px 6px;
  }

  .finance-legend-percent {
    min-width: 40px;
  }

  /* Таблицы финансов — карточки в столбик */
  .finance-tables {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .finance-table-block,
  .finance-table-block:nth-child(4),
  .finance-table-block:nth-child(5) {
    grid-column: 1 / -1;
    padding: 10px;
    border-radius: 10px;
    min-height: auto;
    gap: 8px;
  }

  .finance-table-title {
    font-size: 13px;
    padding-bottom: 6px;
    gap: 6px;
  }

  .finance-table-title i {
    font-size: 15px;
  }

  .finance-table-add-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  .finance-table-list {
    max-height: 260px;
    gap: 4px;
  }

  .finance-row {
    padding: 8px 10px;
    font-size: 12px;
    gap: 6px;
    border-radius: 8px;
  }

  .finance-row-date {
    font-size: 10px;
    min-width: 32px;
  }

  .finance-row-amount {
    font-size: 12px;
    min-width: 64px;
  }

  .finance-row-del {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .finance-table-total {
    font-size: 13px;
    padding-top: 6px;
  }

  /* График месяца (3 столбца + легенда) */
  .finance-month-chart-block {
    padding: 12px;
    gap: 10px;
    flex-direction: column;
    height: auto;
    border-radius: 10px;
  }

  .finance-month-chart-block .finance-month-bars {
    gap: 6px;
    align-items: flex-end;
    height: 120px;
    min-height: 120px;
    padding: 0;
  }

  .finance-month-chart-block .finance-month-group {
    width: 60px;
    height: 100%;
  }

  .finance-month-bar-wrap {
    height: 96px;
    min-height: 96px;
    max-height: 96px;
  }

  .finance-month-chart-block .finance-month-bar {
    width: 40px;
    max-width: 40px;
    max-height: 96px;
  }

  .finance-month-legend {
    width: 100%;
    gap: 4px;
  }

  .finance-month-legend-row {
    padding: 6px 10px;
    gap: 8px;
  }

  .finance-month-legend-color {
    width: 12px;
    height: 12px;
  }

  .finance-month-legend-name {
    font-size: 12px;
  }

  .finance-month-legend-value {
    font-size: 12px;
  }

  /* Статьи */
  .finance-categories-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-bottom: 10px;
  }

  .finance-categories-header h2 {
    justify-content: center;
    font-size: 16px;
  }

  .finance-add-btn.small {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 13px;
    min-height: 44px;
  }

  .finance-categories-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .finance-cat-group {
    padding: 10px;
    border-radius: 10px;
  }

  .finance-cat-group-title {
    font-size: 13px;
    padding-bottom: 6px;
    margin-bottom: 6px;
  }

  .finance-cat-item {
    padding: 8px 10px;
    font-size: 13px;
    min-height: 42px;
    border-radius: 8px;
  }

  .finance-cat-color {
    width: 12px;
    height: 12px;
  }

  .finance-cat-del {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  /* Модалка финансов: type-tabs 3 колонки, компактно */
  .finance-type-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .finance-type-tab {
    padding: 10px 6px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    min-height: 40px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .finance-modal-form {
    gap: 10px;
    margin-bottom: 12px;
  }

  .finance-modal-row {
    gap: 4px;
  }

  .finance-modal-label {
    font-size: 11px;
  }

  .finance-modal-input,
  .finance-modal-select {
    font-size: 14px;
    padding: 10px 12px;
    min-height: 42px;
    border-radius: 10px;
  }

  /* Палитра цветов — компактнее */
  .finance-color-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }

  .finance-color-swatch {
    border-radius: 6px;
  }

  .finance-color-recent .finance-color-swatch {
    width: 24px;
    height: 24px;
  }

  /* ===== НАСТРОЙКИ ===== */
  .settings-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin-bottom: 10px;
    padding: 0;
    overflow: visible;
    justify-content: stretch;
  }

  .settings-tab {
    padding: 10px 6px;
    font-size: 12px;
    min-height: 44px;
    gap: 4px;
    justify-content: center;
    text-align: center;
    flex: none;
    min-width: 0;
  }

  .settings-tab i {
    font-size: 14px;
  }

  /* Темы */
  .themes-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .theme-tile {
    padding: 12px;
    border-radius: 14px;
  }

  .theme-preview {
    height: 84px;
    margin-bottom: 10px;
  }

  .theme-name {
    font-size: 14px;
  }

  .theme-desc {
    font-size: 11px;
  }

  /* Архив привычек */
  .archived-habit-item {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-radius: 10px;
  }

  .habit-archive-name {
    font-size: 13px;
 }
   .habit-archive-date {
    font-size: 11px;
  }

  .restore-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    font-size: 13px;
    min-height: 42px;
  }

  /* ===== СПРАВКА ===== */
  .help-container {
    flex-direction: column;
    gap: 10px;
    min-height: auto;
  }

  .help-sidebar {
    width: 100%;
    padding: 10px 8px;
    border-radius: 12px;
    position: static;
  }

  .help-sidebar-title {
    font-size: 14px;
    padding-bottom: 8px;
    margin-bottom: 6px;
  }

  .help-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .help-nav-item {
    flex: 1 0 auto;
    font-size: 12px;
    padding: 8px 10px;
    min-height: 36px;
    text-align: center;
    white-space: nowrap;
    border-radius: 8px;
  }

  .help-content {
    padding: 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
  }

  .help-content h1 {
    font-size: 18px;
  }

  .help-content h2 {
    font-size: 15px;
    margin: 14px 0 8px;
    padding-bottom: 4px;
  }

  .help-content p {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .help-content li {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .help-content ul {
    padding-left: 18px;
    margin-bottom: 10px;
  }

  .help-tip,
  .help-warning {
    font-size: 12px;
    padding: 10px 12px;
    margin: 12px 0;
    border-radius: 6px;
  }

  .help-content code {
    font-size: 11.5px;
    padding: 2px 5px;
  }

  /* ===== АККАУНТ ===== */
  .account-block {
    padding: 14px;
    border-radius: 14px;
  }

  .account-status {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 10px;
    margin-bottom: 12px;
  }

  .account-icon-google,
  .account-icon-ok {
    font-size: 24px;
  }

  .account-title {
    font-size: 13px;
  }

  .account-email {
    font-size: 13px;
  }

  .account-saved {
    font-size: 11px;
  }

  .account-description {
    font-size: 12px;
    margin-bottom: 14px;
  }

  .account-actions {
    flex-direction: column;
    gap: 8px;
  }

  .account-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px;
    border-radius: 10px;
  }

  .sync-status-card {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 10px;
    margin-bottom: 10px;
  }

  .account-icon-sync {
    font-size: 22px;
  }

  .sync-status-title {
    font-size: 12px;
  }

  .sync-status-desc {
    font-size: 11px;
  }

  /* ===== МОДАЛКИ ===== */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.15, 0.64, 1);
  }

  @keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .modal h3 {
    font-size: 16px;
    gap: 6px;
    margin-bottom: 12px;
  }

  .modal p {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .modal-habit-name {
    font-size: 13px;
    padding: 8px 10px;
  }

  .modal-warning {
    font-size: 12px;
    padding: 10px;
  }

  .modal-buttons {
    flex-direction: column-reverse;
    gap: 8px;
    margin-top: 14px;
    justify-content: stretch;
  }

  .modal-cancel,
  .modal-confirm {
    width: 100%;
    padding: 14px 18px;
    font-size: 14px;
    min-height: 48px;
    border-radius: 10px;
    flex: none;
  }

  .input-modal-input {
    font-size: 15px;
    padding: 12px 14px;
    min-height: 48px;
    margin-bottom: 14px;
  }

  /* Календарь-модалка */
  .cal-modal-list {
    max-height: 50vh;
    margin-bottom: 10px;
  }

  .cal-modal-item {
    padding: 10px 12px;
    gap: 8px;
    min-height: 46px;
    border-radius: 8px;
  }

  .cal-modal-item .cal-modal-checkbox {
    width: 22px;
    height: 22px;
  }

  .cal-modal-item .cal-modal-text {
    font-size: 13px;
  }

  .cal-modal-item .cal-modal-del {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .cal-modal-add {
    gap: 6px;
    margin-bottom: 12px;
  }

  .cal-modal-add input {
    font-size: 14px;
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 10px;
  }

  .cal-modal-add button {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 16px;
  }

  /* ===== ПРИВЕТСТВЕННОЕ ОКНО ===== */
  .welcome-overlay {
    padding: 12px;
  }

  .welcome-modal {
    padding: 22px 18px;
    border-radius: 20px;
    max-height: 92vh;
    overflow-y: auto;
  }

  .welcome-icon {
    font-size: 40px;
    margin-bottom: 8px;
  }

  .welcome-title {
    font-size: 20px;
  }

  .welcome-subtitle {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .welcome-features {
    gap: 6px;
    margin-bottom: 16px;
  }

  .welcome-feature {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 10px;
  }

  .welcome-feature-icon {
    font-size: 20px;
  }

  .welcome-feature-title {
    font-size: 13px;
    margin-bottom: 1px;
  }

  .welcome-feature-desc {
    font-size: 11px;
  }

  .welcome-btn {
    padding: 14px 20px;
    font-size: 15px;
    min-height: 50px;
    border-radius: 10px;
  }

  /* ===== TOAST ===== */
  .toast-container {
    top: 8px;
    right: 8px;
    left: 8px;
  }

  .toast {
    min-width: 0;
    max-width: 100%;
    font-size: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    gap: 8px;
  }

  .toast i {
    font-size: 16px;
  }

  /* ===== БАННЕР СИНХРОНИЗАЦИИ ===== */
  .sync-banner.open {
    padding: 10px 12px;
  }

  .sync-banner-content {
    flex-wrap: wrap;
    gap: 8px;
  }

  .sync-banner-icon {
    font-size: 22px;
  }

  .sync-banner-title {
    font-size: 12px;
  }

  .sync-banner-desc {
    font-size: 11px;
  }

  .sync-banner-actions {
    width: 100%;
    gap: 6px;
  }

  .sync-banner-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
    font-size: 12px;
    min-height: 40px;
    border-radius: 8px;
  }

  /* ===== ОВЕРЛЕЙ ПЕРЕЗАПУСКА ===== */
  .app-reloading-inner {
    padding: 24px 28px;
    margin: 12px;
    border-radius: 16px;
  }

  .app-reloading-spinner {
    font-size: 32px;
  }

  .app-reloading-text {
    font-size: 13px;
  }

  /* ===== СКРОЛЛБАРЫ ===== */
  .content::-webkit-scrollbar {
    width: 6px;
  }

    /* ===== ДНИ — КОМПАКТНЕЕ ===== */
  .day-card {
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    min-height: auto;
  }

  .day-header {
    padding-bottom: 10px;
  }

  .day-progress {
    margin: 2px 0;
  }

  .day-progress-circle {
    width: 80px;
    height: 80px;
  }

  .day-progress-circle::before {
    width: 60px;
    height: 60px;
  }

  .day-progress-text {
    font-size: 15px;
  }

  .day-tasks {
    min-height: 30px;
    max-height: 180px;
    gap: 4px;
  }

  .day-note {
    min-height: 44px;
    font-size: 12px;
    padding: 8px 10px;
  }

  .day-add-task button {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

    /* ===== ПРИВЫЧКИ — КАРТОЧКИ КОМПАКТНО ===== */
  .habit-card-days {
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
  }

  .habit-day {
    gap: 2px;
  }

  .habit-day-label {
    font-size: 9px;
    font-weight: 700;
  }

  .habit-card-check {
    width: 100%;
    max-width: 28px;
    height: 28px;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 6px;
    accent-color: var(--accent);
    margin: 0 auto;
    display: block;
    cursor: pointer;
  }

    /* ===== АНАЛИТИКА — КОМПАКТНО ===== */
  .slide-stats {
    gap: 6px;
  }

  .stat-main {
    padding: 8px;
    border-radius: 8px;
  }

  .stat-value.big {
    font-size: 28px;
  }

  .stat-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .stat-item {
    padding: 6px 8px;
    border-radius: 8px;
  }

  .stat-label {
    font-size: 9px;
    margin-bottom: 1px;
  }

  .stat-value {
    font-size: 13px;
  }

  .diary-stats-row {
    grid-template-columns: 1fr 1fr 1fr !important;
  }

  .chart-bars {
    min-height: 110px;
  }

  .chart-bar {
    max-width: 22px;
  }

  .chart-bar-value,
  .chart-bar-label {
    font-size: 8px;
  }

    /* ===== ФИНАНСЫ — ТАЙЛЫ 1 + 3 ===== */
  .finance-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .finance-tile:first-child {
    grid-column: 1 / -1;
  }

  .finance-tile {
    padding: 8px 10px;
    gap: 3px;
    border-radius: 10px;
  }

  .finance-tile-label {
    font-size: 9px;
    letter-spacing: 0.1px;
  }

  .finance-tile-value {
    font-size: 14px;
  }

  .finance-tile-sub {
    font-size: 9px;
  }

  .finance-tile-bar {
    height: 4px;
    margin-top: 1px;
  }

  .finance-plan-edit {
    font-size: 10px;
    padding: 0 2px;
  }

    /* ===== ФИНАНСЫ — ТАБЛИЦЫ 3 + 2 ===== */
  /* ===== ФИНАНСЫ — ТАБЛИЦЫ В ОДИН СТОЛБЕЦ ===== */
  .finance-tables {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .finance-table-block,
  .finance-table-block:nth-child(1),
  .finance-table-block:nth-child(2),
  .finance-table-block:nth-child(3),
  .finance-table-block:nth-child(4),
  .finance-table-block:nth-child(5) {
    grid-column: auto;
    width: 100%;
    padding: 10px;
    min-height: auto;
    gap: 6px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .finance-table-title {
    font-size: 13px;
    padding-bottom: 6px;
    gap: 6px;
  }

  .finance-table-title i {
    font-size: 14px;
  }

  .finance-table-add-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
    border-radius: 8px;
  }

  .finance-table-list {
    max-height: 200px;
    gap: 4px;
  }

  .finance-row {
    padding: 8px 10px;
    font-size: 12px;
    gap: 6px;
    border-radius: 8px;
    min-height: 42px;
  }

  .finance-row-date {
    font-size: 10px;
    min-width: 34px;
  }

  .finance-row-amount {
    font-size: 12px;
    min-width: 64px;
  }

  .finance-row-del {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .finance-table-total {
    font-size: 13px;
    padding-top: 6px;
  }

  .finance-table-block,
  .finance-table-block:nth-child(1),
  .finance-table-block:nth-child(2),
  .finance-table-block:nth-child(3) {
    grid-column: auto;
    width: 100%;
    padding: 8px;
    min-height: auto;
    gap: 6px;
    border-radius: 10px;
  }

  .finance-table-block:nth-child(4),
  .finance-table-block:nth-child(5) {
    grid-column: auto;
    width: 100%;
    padding: 8px;
    min-height: auto;
    gap: 6px;
    border-radius: 10px;
  }

  .finance-table-title {
    font-size: 11px;
    padding-bottom: 4px;
    gap: 4px;
  }

  .finance-table-title i {
    font-size: 12px;
  }

  .finance-table-add-btn {
    width: 26px;
    height: 26px;
    font-size: 12px;
    border-radius: 6px;
  }

  .finance-table-list {
    max-height: 140px;
    gap: 3px;
  }

  .finance-row {
    padding: 6px 8px;
    font-size: 10px;
    gap: 4px;
    border-radius: 6px;
  }

  .finance-row-date {
    font-size: 9px;
    min-width: 26px;
  }

  .finance-row-cat {
    font-size: 10px;
  }

  .finance-row-amount {
    font-size: 10px;
    min-width: 50px;
  }

  .finance-row-del {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .finance-table-total {
    font-size: 11px;
    padding-top: 4px;
  }

    /* ===== МОДАЛКА ФИНАНСОВ ===== */
  .finance-type-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }

  .finance-type-tab {
    padding: 10px 4px;
    font-size: 11px;
    min-height: 40px;
    border-radius: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    text-align: center;
  }

  .finance-modal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .finance-modal-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .finance-modal-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0;
  }

  .finance-modal-input,
  .finance-modal-select {
    font-size: 14px;
    padding: 10px 12px;
    min-height: 42px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Палитра цветов */
  .finance-color-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .finance-color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }

  .finance-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
  }

  .finance-color-recent-label {
    font-size: 10px;
    margin-top: 4px;
  }

  .finance-color-recent {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
  }

  .finance-color-recent .finance-color-swatch {
    width: 24px;
    height: 24px;
    aspect-ratio: auto;
  }

    /* ===== КАЛЕНДАРЬ — ФИКС ВЫСОТА ===== */
   .calendar-grid {
    gap: 4px;
    grid-auto-rows: minmax(64px, 1fr);
    width: 100%;
    max-width: 100%;
  }

  .calendar-day {
    aspect-ratio: auto !important;
    min-height: 64px !important;
    max-height: none !important;
    height: auto !important;
    padding: 6px 5px !important;
    gap: 3px !important;
    border-radius: 10px;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .calendar-day-number {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    color: var(--text);
  }

  .calendar-day.today .calendar-day-number {
    color: var(--accent-hover);
  }

  .calendar-day-events {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .calendar-event-dot {
    font-size: 9px;
    padding: 1px 3px;
    line-height: 1.2;
    border-left-width: 2px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .calendar-event-count {
    font-size: 9px;
    color: var(--text-muted);
  }

} /* конец @media (max-width: 600px) */

/* =====================================================
   ОЧЕНЬ УЗКИЕ ЭКРАНЫ — 400px
   ===================================================== */
@media (max-width: 400px) {
  .content {
    padding: 6px 8px 12px;
  }

  .block {
    padding: 10px;
  }

  .days-grid {
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
    width: calc(100% + 16px);
  }

  .day-card {
    flex: 0 0 calc(100vw - 32px);
    width: calc(100vw - 32px);
    min-width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .planner-tab {
    font-size: 11px;
    padding: 8px 4px;
    min-height: 36px;
  }

.calendar-day {
    min-height: 58px !important;
    max-height: none !important;
    height: auto !important;
    padding: 5px 4px !important;
  }

  .calendar-day-number {
    font-size: 12px;
  }

  .calendar-event-dot {
    font-size: 8px;
    padding: 1px 2px;
  }

  .habits-stat-name {
    font-size: 11px;
  }
}

/* =====================================================
   ОТКЛЮЧЕНИЕ HOVER НА ТАЧ-УСТРОЙСТВАХ
   ===================================================== */
@media (hover: none) {
  .day-card:hover,
  .block:hover,
  .finance-tile:hover,
  .calendar-day:hover,
  .theme-tile:hover,
  .goal-item:hover,
  .habits-stat-item:hover,
  .finance-row:hover,
  .finance-cat-item:hover {
    transform: none;
    box-shadow: var(--shadow);
    border-color: var(--border);
  }

  .menu-btn:hover,
  .week-btn:hover,
  .calendar-nav-btn:hover,
  .finance-nav-btn:hover {
    background: var(--bg);
    color: var(--text);
  }
}

/* =====================================================
   ПСЕВДОЭЛЕМЕНТЫ ИКОНОК НЕ ЛОВЯТ КЛИКИ
   ===================================================== */
.finance-row-del i,
.finance-row-del i::before,
.finance-row-del i::after,
.finance-cat-del i,
.finance-cat-del i::before,
.finance-cat-del i::after,
.goal-delete i,
.goal-delete i::before,
.goal-delete i::after,
.task-delete i,
.task-delete i::before,
.task-delete i::after,
.habit-delete i,
.habit-delete i::before,
.habit-delete i::after,
.habit-card-delete i,
.habit-card-delete i::before,
.habit-card-delete i::after,
.cal-modal-del i,
.cal-modal-del i::before,
.cal-modal-del i::after {
  pointer-events: none !important;
}

/* =====================================================
   МОБИЛЬНЫЕ ФИКСЫ v1
   ===================================================== */

@media (max-width: 600px) {

  /* ===== ФИКС 1: статичный экран, скролл только внутри .content ===== */
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
  }

  .content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 10px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* ===== ФИКС 2: iOS не зумит инпуты ===== */
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  .goals-add input,
  .habits-add input,
  .day-add-task input,
  .diary-input,
  .diary-textarea,
  .finance-modal-input,
  .finance-modal-select,
  .cal-modal-add input,
  .input-modal-input {
    font-size: 16px !important;
  }

  /* ===== ФИКС 3: календарь — фиксированная высота ячейки ===== */
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    width: 100%;
    max-width: 100%;
    grid-auto-rows: 64px;
  }

  .calendar-day {
    aspect-ratio: unset !important;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    padding: 4px 4px 3px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    box-sizing: border-box;
  }

  .calendar-day-number {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    color: var(--text);
  }

  .calendar-day.today .calendar-day-number {
    color: var(--accent-hover);
  }

  .calendar-day-events {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .calendar-event-dot {
    font-size: 8px;
    padding: 0 2px;
    line-height: 1.2;
    border-left-width: 2px;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
  }

  .calendar-event-count {
    font-size: 8px;
    color: var(--text-muted);
    flex-shrink: 0;
  }
}

/* =====================================================
   МОДАЛКА ДНЕВНИКА
   ===================================================== */
.diary-modal-textarea {
  min-height: 160px;
  resize: vertical;
  font-family: 'Nunito', sans-serif;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .diary-modal-textarea {
    min-height: 200px;
    font-size: 16px !important;
  }

  /* Увеличиваем «Мысли» в карточке дневника */
  .diary-textarea {
    min-height: 200px !important;
  }
}

/* =====================================================
   ПЛАШКА ШТРАФА (Трекер привычек)
   ===================================================== */
.penalty-info {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.penalty-info i {
  font-size: 18px;
  flex-shrink: 0;
}

.penalty-info.warning {
  background: #FBF3D5;
  border: 1px solid #E8D89A;
  color: #8B6F2A;
}

.penalty-info.warning i {
  color: #B8935A;
}

/* Финальный штраф (неделя закрыта) — красная плашка */
.penalty-info:not(.warning) {
  background: #FBE0E0;
  border: 1px solid #F5A9A9;
  color: #8B4A4A;
}

.penalty-info:not(.warning) i {
  color: #C97070;
}

/* =====================================================
   ТРИГГЕР ПОЛЯ ДНЕВНИКА (мобильный)
   ===================================================== */
.diary-field-trigger {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  min-height: 42px;
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.diary-field-trigger:active {
  border-color: var(--accent);
  background: #FFFDF9;
}

.diary-field-trigger.placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* ===== ССЫЛКИ В WELCOME ===== */
.welcome-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}

.welcome-links a {
  color: var(--accent-hover);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.welcome-links a:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .welcome-links {
    gap: 10px;
    font-size: 12px;
  }
}

/* =====================================================
   ПРИВЫЧКИ — ФИНАЛЬНЫЙ ФИКС (десктоп + мобильный)
   ===================================================== */

/* ===== Строка ввода + кнопка ===== */
.habits-add {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
  width: 100%;
}

.habits-add input {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

.habits-add input::placeholder {
  color: var(--text-muted);
}

.habits-add input:focus {
  border-color: var(--accent);
  background: #FFFDF9;
}

.habits-add button {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.habits-add button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 201, 154, 0.35);
}

.habits-add button:active {
  transform: translateY(0) scale(0.95);
}

.habits-add button i {
  font-size: 16px;
}

/* ===== ТАБЛИЦА (десктоп) ===== */
.habits-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.habits-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
}

.habits-table thead th {
  font-family: 'Rubik', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Привычка — широкая */
.habits-table thead th.habit-name-col,
.habits-table tbody td:first-child {
  width: 55%;
  text-align: left;
  padding-left: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Дни Пн–Вс — узкие, фиксированные */
.habits-table thead th:nth-child(2),
.habits-table thead th:nth-child(3),
.habits-table thead th:nth-child(4),
.habits-table thead th:nth-child(5),
.habits-table thead th:nth-child(6),
.habits-table thead th:nth-child(7),
.habits-table thead th:nth-child(8),
.habits-table tbody td:nth-child(2),
.habits-table tbody td:nth-child(3),
.habits-table tbody td:nth-child(4),
.habits-table tbody td:nth-child(5),
.habits-table tbody td:nth-child(6),
.habits-table tbody td:nth-child(7),
.habits-table tbody td:nth-child(8) {
  width: 5%;
  min-width: 0;
  text-align: center;
  padding: 8px 2px;
}

/* Прогресс */
.habits-table thead th:nth-child(9),
.habits-table tbody td:nth-child(9) {
  width: 8%;
  text-align: center;
  padding-left: 12px;
}

/* Звёзды */
.habits-table thead th:nth-child(10),
.habits-table tbody td:nth-child(10) {
  width: 12%;
  text-align: center;
}

/* Крестик */
.habits-table thead th:nth-child(11),
.habits-table tbody td:nth-child(11) {
  width: 4%;
  text-align: center;
}

.habits-table tbody tr {
  background: var(--bg);
}

.habits-table tbody td {
  padding: 8px 6px;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.habits-table tbody td:first-child {
  border-left: 1px solid var(--border);
  border-radius: 10px 0 0 10px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.habits-table tbody td:last-child {
  border-right: 1px solid var(--border);
  border-radius: 0 10px 10px 0;
}

.habit-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  transition: transform 0.15s ease;
  vertical-align: middle;
}

.habit-check:hover {
  transform: scale(1.15);
}

.habit-check:checked {
  animation: checkPulse 0.35s ease;
}

.habit-progress {
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  color: var(--accent-hover);
}

.habit-stars {
  font-size: 14px;
  color: #E8B84B;
  letter-spacing: 1px;
}

.habit-delete {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.habit-delete:hover {
  background: var(--error);
  color: #FFFFFF;
  transform: rotate(90deg) scale(1.15);
}

/* ===== МОБИЛЬНЫЙ — таблицу скрываем, карточки показываем ===== */
@media (max-width: 900px) {
  .habits-table-wrap {
    display: none !important;
  }

  .habits-cards {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
  }

  .habits-add {
    flex-wrap: wrap;
  }

  .habits-add input {
    display: none;
  }

  .habits-add button {
    width: 100%;
    justify-content: center;
  }
}

/* ===== МОДАЛКА СОЗДАНИЯ ПРИВЫЧКИ ===== */
.habit-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.habit-modal-label {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.habit-schedule-picker {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.habit-schedule-day {
  flex: 1;
  min-width: 42px;
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
}

.habit-schedule-day:hover {
  border-color: var(--accent);
  color: var(--text);
}

.habit-schedule-day.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent-hover);
}

.habit-schedule-day.active:hover {
  background: var(--accent-hover);
}

@media (max-width: 600px) {
  .habit-schedule-day {
    min-width: 0;
    padding: 10px 2px;
    font-size: 12px;
  }
}


/* =====================================================
   АКТИВАЦИЯ ЛИЦЕНЗИИ
   ===================================================== */
.activation-block {
  max-width: 600px;
  margin: 0 auto;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.activation-status {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: left;
}

.activation-status-in {
  border-color: var(--accent);
  background: rgba(168, 201, 154, 0.08);
}

.activation-icon {
  font-size: 32px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.activation-icon-ok {
  font-size: 32px;
  color: var(--accent-hover);
  flex-shrink: 0;
}

.activation-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.activation-title {
  font-family: 'Comfortaa', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.activation-saved {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

.activation-saved code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--text);
  user-select: all;
}

.activation-description {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
  text-align: left;
}

.activation-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.activation-input {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  text-transform: uppercase;
  min-width: 0;
}

.activation-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.5px;
}

.activation-input:focus {
  border-color: var(--accent);
  background: #FFFDF9;
}

.activation-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(168, 201, 154, 0.3);
}

.activation-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 201, 154, 0.4);
}

.activation-btn:active {
  transform: translateY(0) scale(0.97);
}

.activation-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.activation-btn-highlight {
  animation: activationPulse 0.8s ease-in-out 2;
  box-shadow: 0 0 0 4px rgba(168, 201, 154, 0.5);
}

@keyframes activationPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(168, 201, 154, 0.5);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 8px rgba(168, 201, 154, 0.2);
  }
}

.activation-hint {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.activation-hint a {
  color: var(--accent-hover);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.activation-hint a:hover {
  color: var(--text);
}

/* ===== КАРТОЧКА СПИСКА УСТРОЙСТВ ===== */
.activation-devices-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.activation-devices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.activation-devices-title {
  font-family: 'Comfortaa', cursive;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.activation-devices-title i {
  color: var(--accent-hover);
  font-size: 16px;
}

.activation-devices-count {
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-hover);
  background: var(--block);
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.activation-devices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activation-empty {
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px 10px;
  font-style: italic;
}

.activation-device-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s ease;
}

.activation-device-row:hover {
  border-color: var(--accent);
}

.activation-device-row.current {
  border-color: var(--accent);
  background: rgba(168, 201, 154, 0.08);
}

.activation-device-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activation-device-name {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.activation-device-badge {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.activation-device-date {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
}

.activation-device-del {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.activation-device-del:hover {
  background: var(--error);
  color: #FFFFFF;
  transform: rotate(90deg) scale(1.1);
}

.activation-device-del:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.activation-device-del i {
  pointer-events: none;
}

/* ===== ДЕЙСТВИЯ ===== */
.activation-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 600px) {
  .activation-block {
    padding: 16px;
    border-radius: 14px;
  }

  .activation-status {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 10px;
    margin-bottom: 14px;
  }

  .activation-icon,
  .activation-icon-ok {
    font-size: 24px;
  }

  .activation-title {
    font-size: 13px;
  }

  .activation-saved {
    font-size: 11px;
  }

  .activation-description {
    font-size: 12px;
    margin-bottom: 14px;
  }

  .activation-form {
    flex-direction: column;
    gap: 8px;
  }

  .activation-input {
    font-size: 16px;
    padding: 12px 14px;
    min-height: 48px;
    letter-spacing: 2px;
    text-align: center;
  }

  .activation-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
    min-height: 48px;
  }

  .activation-devices-card {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .activation-devices-title {
    font-size: 13px;
  }

  .activation-devices-count {
    font-size: 12px;
    padding: 2px 8px;
  }

  .activation-device-row {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 10px;
  }

  .activation-device-name {
    font-size: 12px;
    gap: 6px;
  }

  .activation-device-badge {
    font-size: 9px;
    padding: 1px 6px;
  }

  .activation-device-date {
    font-size: 10px;
  }

  .activation-device-del {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .activation-actions .account-btn {
    width: 100%;
    justify-content: center;
  }
}

/* =====================================================
   TRIAL-БАННЕР
   ===================================================== */
.trial-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

.trial-banner i {
  font-size: 18px;
  flex-shrink: 0;
}

.trial-banner-text {
  flex: 1;
  min-width: 0;
}

.trial-banner-text b {
  font-weight: 700;
}

.trial-banner-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Info — trial активен */
.trial-banner-info {
  background: #FBF3D5;
  border-bottom: 1px solid #E8D89A;
  color: #8B6F2A;
}

.trial-banner-info i {
  color: #B8935A;
}

.trial-banner-info .trial-banner-btn {
  background: #E8B84B;
  color: #FFFFFF;
}

.trial-banner-info .trial-banner-btn:hover {
  background: #D9A83B;
  transform: translateY(-1px);
}

/* Warning — trial закончился */
.trial-banner-warning {
  background: #FBE0E0;
  border-bottom: 1px solid #F5A9A9;
  color: #8B4A4A;
}

.trial-banner-warning i {
  color: #C97070;
}

.trial-banner-warning .trial-banner-btn {
  background: #E88F8F;
  color: #FFFFFF;
}

.trial-banner-warning .trial-banner-btn:hover {
  background: #D47070;
  transform: translateY(-1px);
}

/* Мобильная адаптация */
@media (max-width: 600px) {
  .trial-banner {
    padding: 8px 12px;
    font-size: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .trial-banner i {
    font-size: 16px;
  }

  .trial-banner-btn {
    padding: 5px 12px;
    font-size: 11px;
  }
}

/* =====================================================
   LOCKDOWN-ЗАГЛУШКИ
   ===================================================== */
.lockdown-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 14px;
  gap: 12px;
  min-height: 280px;
  width: calc(100% - 40px);
  max-width: 700px;
  margin: 20px auto;
  flex: 1 1 auto;
  box-sizing: border-box;
}
.lockdown-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.lockdown-title {
  font-family: 'Comfortaa', cursive;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.lockdown-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.55;
}

.lockdown-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(168, 201, 154, 0.3);
}

.lockdown-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 201, 154, 0.4);
}

@media (max-width: 600px) {
  .lockdown-block {
    padding: 32px 16px;
    min-height: 220px;
  }
  .lockdown-icon {
    font-size: 36px;
  }
  .lockdown-title {
    font-size: 15px;
  }
  .lockdown-desc {
    font-size: 12px;
  }
  .lockdown-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 14px;
  }
}