:root {
  /* Основная тёмная тема */
  --primary-color: #0a84ff;
  --background-color: #000000;
  --surface-color: #1c1c1e;
  --text-primary: #ffffff;
  --text-secondary: #8e8e93;
  --border-color: #38383a;
  --accent-color: #34c759;
  --warning-color: #ff9500;
  --error-color: #ff3b30;
  --income-color: #30d158;
  --expense-color: #ff453a;
}

[data-theme="light"] {
  /* Светлая тема */
  --background-color: #ffffff;
  --surface-color: #f2f2f7;
  --text-primary: #000000;
  --text-secondary: #8e8e93;
  --border-color: #c6c6c8;
  --income-color: #34c759;
  --expense-color: #ff3b30;
  --warning-color: #ff9500;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

body {
  background-color: var(--background-color);
  color: var(--text-primary);
  transition: background-color 0.3s, color 0.3s;
  padding-bottom: 80px;
}

.container {
  max-width: 100%;
  padding: 0 16px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background-color: var(--background-color);
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border-color);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
/* Когда есть аватар, скрываем эмодзи и показываем изображение */
.user-avatar span[style*="background-image"] {
  font-size: 0; /* Скрываем эмодзи */
}

.app-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #007aff, #5856d6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.settings-btn {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  z-index: 101;
}

/* Date Section */
.date-section {
  padding: 20px 16px 16px;
}

.day-name {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.month-year {
  font-size: 16px;
  color: var(--text-secondary);
  transition: color 0.2s;
  cursor: pointer;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
}

.month-year:hover {
  color: var(--primary-color);
  background-color: rgba(0, 122, 255, 0.1);
}

/* Calendar */
.calendar {
  margin: 16px 0;
  padding: 0 16px;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

.day.current {
  background-color: var(--primary-color);
  color: white;
}

.day.selected {
  background-color: rgba(0, 122, 255, 0.2);
  color: var(--primary-color);
  font-weight: 600;
}

.day.other-month {
  color: var(--text-secondary);
  opacity: 0.5;
}

.day.priority::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 50%;
}

/* Tasks Section - ИСПРАВЛЕННЫЕ СТИЛИ БЕЗ РАМОК */
.tasks-section {
  margin: 24px 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
}

.priority-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  transition: all 0.3s ease;
  background-color: var(--background-color);
  border: none;
  box-shadow: none;
}

.priority-toggle:hover {
  background-color: var(--background-color);
  box-shadow: none;
}

.priority-toggle.active {
  color: var(--primary-color);
  background-color: var(--background-color);
  border: none;
  box-shadow: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: var(--border-color);
  border-radius: 12px;
  transition: background-color 0.3s;
  cursor: pointer;
  box-shadow: none;
}

.toggle-switch.active {
  background-color: var(--primary-color);
  box-shadow: none;
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: none;
}

.toggle-switch.active .toggle-knob {
  transform: translateX(20px);
}

/* Tasks Section - ИСПРАВЛЕННЫЕ СТИЛИ БЕЗ РАМОК */
.tasks-section {
  margin: 24px 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 20px;
  font-weight: 600;
}

.priority-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  transition: all 0.3s ease;
  background-color: var(--background-color);
  border: none;
  box-shadow: none;
}

.priority-toggle:hover {
  background-color: var(--background-color);
  box-shadow: none;
}

.priority-toggle.active {
  color: var(--primary-color);
  background-color: var(--background-color);
  border: none;
  box-shadow: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: var(--border-color);
  border-radius: 12px;
  transition: background-color 0.3s;
  cursor: pointer;
  box-shadow: none;
}

.toggle-switch.active {
  background-color: var(--primary-color);
  box-shadow: none;
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: none;
}

.toggle-switch.active .toggle-knob {
  transform: translateX(20px);
}

/* Task List - ИСПРАВЛЕННЫЙ ФОН БЕЗ РАМКИ */
.task-list {
  background-color: var(--background-color);
  border-radius: 0;
  overflow: hidden;
  position: relative;
  border: none;
}

.task-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  position: relative;
  transition: transform 0.3s ease, background-color 0.3s;
  background-color: var(--background-color);
  touch-action: pan-y;
}

.task-item:last-child {
  border-bottom: none;
}

.task-item.swipe-delete {
  background-color: rgba(255, 59, 48, 0.1);
  transform: translateX(-80px);
}

.task-item.overdue {
  background-color: rgba(255, 59, 48, 0.08);
  border-left: 3px solid var(--error-color);
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s;
}

.task-checkbox.checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.task-checkbox.checked::after {
  content: "✓";
  color: white;
  font-size: 12px;
}

.task-content {
  flex: 1;
  min-height: 20px;
}

.task-title {
  font-size: 16px;
  margin-bottom: 4px;
  min-height: 20px;
}

.task-time {
  font-size: 14px;
  color: var(--text-secondary);
  min-height: 16px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.task-date {
  font-size: 12px;
  color: var(--text-secondary);
  background-color: rgba(0, 122, 255, 0.1);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 500;
}

.overdue-badge {
  background-color: var(--error-color);
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  margin-left: auto;
  margin-right: 8px;
}

.task-actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.task-item:hover .task-actions {
  opacity: 1;
}

.task-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: #8e8e93;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}

.task-action-btn.edit-btn:hover {
  color: #007aff;
  background: rgba(0, 122, 255, 0.1);
}

.task-action-btn.delete-btn:hover {
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.1);
}

[data-theme="dark"] .task-action-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #8e8e93;
}

[data-theme="dark"] .task-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.no-tasks-message {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--background-color);
}

.no-tasks-text {
  font-size: 16px;
  font-style: italic;
}

/* Add Task - ИСПРАВЛЕННЫЙ ФОН БЕЗ РАМКИ */
.add-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: var(--primary-color);
  cursor: pointer;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.2s;
  background-color: var(--background-color);
}

.add-task:hover {
  background-color: rgba(0, 122, 255, 0.1);
}

/* Budget Analytics - ИСПРАВЛЕННЫЕ СТИЛИ БЕЗ РАМОК */
.budget-section {
  margin: 24px 16px;
}

.budget-period {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

.budget-card {
  background-color: var(--background-color);
  border-radius: 0;
  padding: 16px;
  margin-top: 12px;
  border: none;
}

.budget-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.category-name {
  font-size: 16px;
  font-weight: 500;
}

.category-amount {
  font-size: 14px;
  color: var(--text-secondary);
}

.budget-progress {
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  margin: 8px 0 16px 0;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
  width: 0%;
}

#incomeProgress {
  background-color: var(--income-color) !important;
}

#expenseProgress {
  background-color: var(--expense-color) !important;
}

#categoriesProgress {
  background-color: var(--warning-color) !important;
}

/* AI Analytics Section - ИСПРАВЛЕННЫЕ СТИЛИ БЕЗ РАМОК */
.ai-section {
  margin: 24px 16px;
}

.ai-status {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 8px;
  background-color: var(--surface-color);
  border-radius: 6px;
}

.ai-card {
  background-color: var(--background-color);
  border-radius: 0;
  padding: 16px;
  margin-top: 12px;
  border: none;
}

.ai-description {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ai-icon {
  display: none;
}

.ai-text {
  flex: 1;
}

.ai-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.ai-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.ai-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.ai-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ai-btn.primary {
  background-color: var(--primary-color);
  color: white;
}

.ai-btn.primary:hover {
  background-color: #0056cc;
  transform: translateY(-1px);
}

.ai-btn.secondary {
  background-color: rgba(0, 122, 255, 0.1);
  color: var(--primary-color);
}

.ai-btn.secondary:hover {
  background-color: rgba(0, 122, 255, 0.2);
  transform: translateY(-1px);
}

.ai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.ai-btn-icon {
  font-size: 16px;
}

.ai-result {
  background-color: var(--background-color);
  border-radius: 0;
  padding: 16px;
  border: none;
  display: none;
  animation: slideDown 0.3s ease;
}

.ai-result.show {
  display: block;
}

.ai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ai-result-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-close-btn:hover {
  background-color: var(--surface-color);
  color: var(--text-primary);
}

.ai-result-content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.ai-result-content p {
  margin-bottom: 8px;
}

.ai-result-content ul {
  margin-left: 16px;
  margin-bottom: 8px;
}

.ai-result-content li {
  margin-bottom: 4px;
}

/* Кнопка меню внизу */
.menu-btn-bottom {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 35px;
  cursor: pointer;
  z-index: 100;
  padding: 10px;
}

/* Modals */
.add-task-modal,
.delete-modal,
.month-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background-color: var(--background-color);
  border-radius: 14px;
  z-index: 2001;
  width: 320px;
  max-width: 90vw;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.add-task-modal.active,
.delete-modal.active,
.month-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.delete-modal {
  width: 280px;
}

.modal-content {
  padding: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  padding: 16px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.input-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--surface-color);
  color: var(--text-primary);
  font-size: 16px;
  transition: border-color 0.3s;
  height: 44px;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.cancel-btn,
.save-btn,
.delete-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.cancel-btn {
  background-color: var(--surface-color);
  color: var(--text-primary);
}

.cancel-btn:hover {
  background-color: var(--border-color);
}

.save-btn {
  background-color: var(--primary-color);
  color: white;
}

.save-btn:hover {
  background-color: #0056cc;
}

.delete-btn {
  background-color: var(--error-color);
  color: white;
}

.delete-btn:hover {
  background-color: #d70015;
}

.delete-modal .modal-body {
  text-align: center;
}

.delete-modal .modal-body p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

.months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px;
}

.month-option {
  padding: 12px 8px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
  background-color: var(--background-color);
}

.month-option:hover {
  background-color: var(--surface-color);
}

.month-option.active {
  background-color: var(--primary-color);
  color: white;
}

/* Modal Menu */
.modal-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--surface-color);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  padding: 16px;
  transform: translateY(100%);
  transition: transform 0.3s;
  z-index: 1000;
}

.modal-menu.active {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.drag-handle {
  width: 36px;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
}

.modal-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
  color: inherit;
  background-color: var(--background-color);
}

.modal-item:last-child {
  margin-bottom: 0;
}

.modal-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .modal-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.modal-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.modal-label {
  font-size: 16px;
  font-weight: 500;
}

/* Settings Modal */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--background-color);
  z-index: 2000;
  transform: translateX(100%);
  transition: transform 0.3s;
  overflow-y: auto;
}

.settings-modal.active {
  transform: translateX(0);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.settings-title {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--primary-color);
  cursor: pointer;
  padding: 4px;
}

.settings-option {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--background-color);
}

.theme-toggle {
  display: flex;
  gap: 8px;
}

.theme-option {
  padding: 8px 16px;
  border-radius: 8px;
  background-color: var(--surface-color);
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.theme-option.active {
  background-color: var(--primary-color);
  color: white;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Премиум стили в стиле iOS */
.premium-badge {
  background: var(--primary-color);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.premium-feature {
  position: relative;
}

.premium-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface-color);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid var(--border-color);
}

.premium-card {
  background-color: var(--background-color);
  color: var(--text-primary);
  border-radius: 0;
  padding: 16px;
  margin: 16px 0;
  border: none;
}

.premium-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.premium-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.premium-features {
  margin: 16px 0;
}

.premium-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.premium-feature-item::before {
  content: "✓";
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.premium-price {
  text-align: center;
  margin-top: 16px;
}

.price {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.buy-premium-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s;
}

.buy-premium-btn:hover {
  background-color: #0056cc;
}

/* Стили для заблокированных функций */
.feature-locked {
  position: relative;
}

.feature-locked::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  pointer-events: none;
}

/* Правовые ссылки в настройках */
.legal-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background-color: var(--background-color);
}

.legal-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
}

.legal-link:hover {
  text-decoration: underline;
}

/* AI Loading */
.ai-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2002;
  display: none;
  align-items: center;
  justify-content: center;
}

.ai-loading.active {
  display: flex;
}

.ai-loading-content {
  background-color: var(--background-color);
  padding: 24px;
  border-radius: 14px;
  text-align: center;
  max-width: 280px;
  width: 90%;
  animation: scaleIn 0.3s ease;
}

.ai-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

.ai-loading-content p {
  font-size: 16px;
  color: var(--text-primary);
  margin: 0;
}

/* iOS стильные модальные окна для AI */
.ai-modal.ios-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ai-modal.ios-modal.active {
  display: flex;
}

.ios-modal-content {
  background-color: var(--background-color);
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.3s ease;
}

.ios-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.ios-modal-title {
  font-size: 18px;
  font-weight: 600;
}

.ios-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.ios-modal-close:hover {
  background-color: var(--surface-color);
  color: var(--text-primary);
}

.ios-modal-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  max-height: 50vh;
}

.ios-modal-footer {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.ios-button {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ios-button.primary {
  background-color: var(--primary-color);
  color: white;
}

.ios-button.primary:hover {
  background-color: #0056cc;
}

.ios-button.secondary {
  background-color: var(--surface-color);
  color: var(--text-primary);
}

.ios-button.secondary:hover {
  background-color: var(--border-color);
}

.ai-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background-color: var(--background-color);
}

.ios-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.ai-loading-state p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

.ai-result-state {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.ai-result-text p {
  margin-bottom: 12px;
}

.ai-result-text ul {
  margin-left: 20px;
  margin-bottom: 12px;
}

.ai-result-text li {
  margin-bottom: 6px;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Мобильная адаптация */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
    margin: 0 auto;
    max-width: 100%;
    overflow-x: hidden;
  }

  .header {
    padding: 12px 12px;
  }

  .date-section {
    padding: 16px 12px 12px;
  }

  .calendar {
    margin: 12px 0;
    padding: 0 12px;
  }

  .tasks-section {
    margin: 20px 12px;
  }

  .budget-section {
    margin: 20px 12px;
  }

  .ai-section {
    margin: 20px 12px;
  }

  /* Улучшаем календарь для мобильных */
  .day {
    height: 36px;
    font-size: 15px;
  }

  .weekdays div {
    font-size: 13px;
  }

  /* Улучшаем задачи */
  .task-item {
    padding: 14px;
    min-height: 56px;
  }

  .task-title {
    font-size: 16px;
  }

  .task-time {
    font-size: 14px;
  }

  /* Адаптируем премиум карточку */
  .premium-card {
    margin: 12px 0;
    padding: 14px;
  }

  .price {
    font-size: 22px;
  }

  .buy-premium-btn {
    padding: 14px 24px;
    font-size: 17px;
  }

  .ai-actions {
    flex-direction: column;
  }

  .ai-btn {
    width: 100%;
  }

  .ai-modal.ios-modal {
    padding: 10px;
  }

  .ios-modal-content {
    max-height: 85vh;
  }

  .ios-modal-body {
    padding: 16px;
    max-height: 60vh;
  }
}

/* Темная тема для премиум элементов */
[data-theme="dark"] .premium-card {
  background-color: var(--background-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .premium-lock {
  background: var(--surface-color);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .feature-locked::after {
  background: rgba(255, 255, 255, 0.02);
}

/* Улучшения для iPad и планшетов */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    max-width: 600px;
    margin: 0 auto;
  }

  .premium-card {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Улучшения для очень маленьких экранов */
@media (max-width: 320px) {
  .container {
    padding: 0 8px;
  }

  .header {
    padding: 10px 8px;
  }

  .date-section {
    padding: 12px 8px 10px;
  }

  .calendar {
    margin: 10px 0;
    padding: 0 8px;
  }

  .day {
    height: 32px;
    font-size: 13px;
  }

  .weekdays div {
    font-size: 11px;
  }

  .tasks-section,
  .budget-section,
  .ai-section {
    margin: 16px 8px;
  }

  .premium-card {
    padding: 12px;
  }

  .price {
    font-size: 20px;
  }
}
.premium-feature.highlight {
  animation: premium-pulse 2s ease-in-out;
}

@keyframes premium-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(52, 199, 89, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.user-avatar:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
}

.user-avatar span {
  font-size: 20px;
  transition: opacity 0.3s ease;
}

.user-avatar.has-avatar span {
  opacity: 0;
}
/* Стили для логотипа как в login.html */
.app-title .logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

[data-theme="dark"] .app-title .logo {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .app-title .logo {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.app-title .logo-content {
  text-align: center;
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.app-title .logo-main-text {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #000000 0%, #222222 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  line-height: 1;
  position: relative;
  text-shadow: 1px 0 0 rgba(120, 120, 120, 0.8),
    2px 0 0 rgba(150, 150, 150, 0.5);
  margin: 0;
}

[data-theme="dark"] .app-title .logo-main-text {
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 1px 0 0 rgba(0, 0, 0, 0.4), 2px 0 0 rgba(0, 0, 0, 0.2);
}

.app-title .logo-sub-text {
  display: none; /* Скрываем подпись Analyst в header */
}

/* Анимация для логотипа */
@keyframes subtleGlow {
  0%,
  100% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.15),
      0 0 10px rgba(255, 255, 255, 0.05);
  }
}

.app-title .logo {
  animation: subtleGlow 4s ease-in-out infinite;
}

/* Обновляем app-title для правильного расположения */
.app-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Убираем старую синюю иконку */
.app-logo {
  display: none;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .app-title .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    margin-right: 10px;
  }

  .app-title .logo-main-text {
    font-size: 1rem;
  }

  .app-title {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .app-title .logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-right: 8px;
  }

  .app-title .logo-main-text {
    font-size: 0.9rem;
  }

  .app-title {
    font-size: 15px;
  }
}
/* Добавьте в dashboard.css или создайте отдельный файл */
.notification-permission-banner {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e5e7;
  z-index: 10000;
  max-width: 400px;
  animation: slideInRight 0.3s ease-out;
}

.permission-banner-content {
  padding: 20px;
  position: relative;
}

.permission-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.permission-text h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
}

.permission-text p {
  margin: 0 0 15px 0;
  color: #86868b;
  font-size: 14px;
  line-height: 1.4;
}

.permission-steps {
  background: #f5f5f7;
  border-radius: 8px;
  padding: 12px;
}

.step {
  font-size: 12px;
  color: #515154;
  margin-bottom: 6px;
  padding-left: 8px;
}

.step:last-child {
  margin-bottom: 0;
}

.permission-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #86868b;
  padding: 5px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Темная тема */
[data-theme="dark"] .notification-permission-banner {
  background: #1d1d1f;
  border-color: #424245;
}

[data-theme="dark"] .permission-text h3 {
  color: #f5f5f7;
}

[data-theme="dark"] .permission-text p {
  color: #a1a1a6;
}

[data-theme="dark"] .permission-steps {
  background: #2c2c2e;
}

[data-theme="dark"] .step {
  color: #d0d0d0;
}

/* Дополнительный стиль для красного текста времени */
.overdue-time-text {
  color: #ff3b30 !important;
  font-weight: 600;
}
/* Индикаторы задач в календаре */
.day {
  position: relative;
}

.task-indicator {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.task-indicator.planned {
  background-color: #007aff; /* Синий - запланированные */
}

.task-indicator.completed {
  background-color: #34c759; /* Зеленый - выполненные/прошлые */
}

.task-indicator.overdue {
  background-color: #ff3b30; /* Красный - просроченные */
}

/* Улучшаем отображение дней */
.day-number {
  font-size: 16px;
  font-weight: 500;
}

.day.current .day-number {
  background-color: #007aff;
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.day.selected .day-number {
  background-color: #e5e5ea;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
/* Добавьте в CSS */
.loading-tasks {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--system-label);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--system-gray5);
  border-top: 3px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--error-color);
}

.error-message button {
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.task-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin: 2px auto 0;
}

.task-indicator.overdue {
  background-color: var(--error-color);
}

.task-indicator.completed {
  background-color: var(--success-color);
}

.task-indicator.planned {
  background-color: var(--accent-color);
}
.input-group input[type="date"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-background);
  color: var(--text-primary);
  font-size: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Стили для секции контактов */
.contact-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.contact-email {
    text-align: right;
}

.contact-email a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
}

.contact-email a:hover {
    text-decoration: underline;
}

/* Для английской версии */
[lang="en"] .contact-section .settings-option div:first-child {
    font-weight: 500;
}
