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

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

* {
  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: 20px;
}

.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);
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--primary-color);
  font-size: 24px;
  font-weight: bold;
}

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

.app-logo {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #007aff, #5856d6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.add-card-btn {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
}

/* Sections */
.cards-section {
  margin: 20px 0;
}

.transactions-section {
  margin: 24px 0;
}

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

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

/* Quick Actions */
.quick-actions {
  margin: 20px 0;
}

.action-button {
  width: 100%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 16px;
  font-weight: 600;
}

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

.action-icon {
  font-size: 20px;
  font-weight: bold;
}

.action-label {
  font-size: 16px;
}

/* Cards List */
.cards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-item {
  border-radius: 16px;
  padding: 20px;
  color: white;
  position: relative;
  min-height: 180px;
}

.card-bank-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  margin-bottom: 12px;
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  backdrop-filter: blur(10px);
}

.card-bank-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  opacity: 0.9;
}

.card-chip {
  width: 40px;
  height: 30px;
  background: linear-gradient(135deg, #ffd700, #ffec8b);
  border-radius: 6px;
  margin-bottom: 20px;
  position: relative;
}

.card-chip::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.card-number {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 2px;
  margin-bottom: 20px;
  font-family: "Courier New", monospace;
}

.card-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-holder,
.card-expiry {
  display: flex;
  flex-direction: column;
}

.card-label {
  font-size: 10px;
  opacity: 0.7;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.card-value {
  font-size: 14px;
  font-weight: 500;
}

.card-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}

.card-action-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

/* Transactions List - ИСПРАВЛЕННЫЕ СТИЛИ БЕЗ ТЕНИ И С ПРАВИЛЬНЫМ ФОНОМ */
.transactions-list {
  background-color: var(--background-color);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.transaction-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--background-color);
  position: relative;
  transition: background-color 0.2s ease;
}

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

.transaction-info {
  flex: 1;
}

.transaction-description {
  font-size: 16px;
  margin-bottom: 4px;
}

.transaction-meta {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
}

.transaction-category {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  background-color: var(--border-color);
}

.transaction-amount {
  font-size: 16px;
  font-weight: 600;
}

.transaction-amount.income {
  color: var(--income-color);
}

.transaction-amount.expense {
  color: var(--expense-color);
}

.transaction-amount.other {
  color: var(--other-color);
}

.no-data-message {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  background-color: var(--background-color);
}

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

.no-data-hint {
  font-size: 14px;
  margin-top: 8px;
  opacity: 0.7;
}

/* Security Notice - ИСПРАВЛЕННЫЙ ДЛЯ МОБИЛЬНЫХ */
.security-notice {
  background-color: var(--surface-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  border: 1px solid var(--border-color);
}

.security-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.security-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.premium-text {
  color: var(--primary-color);
  font-weight: 600;
}

/* Modal */
.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: 340px;
  max-width: 90vw;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.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;
  max-height: 60vh;
  overflow-y: auto;
}

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

/* Card Preview in Modal */
.card-preview {
  border-radius: 12px;
  padding: 16px;
  color: white;
  margin-bottom: 20px;
  min-height: 140px;
  position: relative;
}

/* Input Groups */
.input-group {
  margin-bottom: 16px;
}

.input-row {
  display: flex;
  gap: 12px;
}

.input-row .input-group {
  flex: 1;
  margin-bottom: 0;
}

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

.input-group input {
  width: 100%;
  padding: 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;
}

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

.input-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Amount Input */
.amount-input-group {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  background-color: var(--surface-color);
  border-radius: 8px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
}

.currency-symbol {
  font-size: 20px;
  font-weight: 600;
  margin-right: 8px;
  color: var(--text-secondary);
}

.amount-input {
  border: none;
  background: none;
  font-size: 24px;
  font-weight: 600;
  padding: 12px 0;
  width: 100%;
  color: var(--text-primary);
}

.amount-input:focus {
  outline: none;
}

/* Cards Selector */
.cards-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--background-color);
}

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

.card-option.selected {
  border-color: var(--primary-color);
  background-color: rgba(0, 122, 255, 0.1);
}

.card-option-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-option.selected .card-option-radio {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
}

.card-option.selected .card-option-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
}

.card-option-info {
  flex: 1;
}

.card-option-name {
  font-weight: 500;
  margin-bottom: 2px;
}

.card-option-number {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Operation Type Selector */
.operation-type-selector {
  display: flex;
  gap: 8px;
}

.operation-type-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--background-color);
}

.operation-type-btn:hover {
  background-color: var(--surface-color);
}

.operation-type-btn.selected {
  border-color: var(--primary-color);
  background-color: rgba(0, 122, 255, 0.1);
}

.operation-type-btn.income.selected {
  border-color: var(--income-color);
  background-color: rgba(52, 199, 89, 0.1);
}

.operation-type-btn.expense.selected {
  border-color: var(--expense-color);
  background-color: rgba(255, 59, 48, 0.1);
}

.operation-type-btn.other.selected {
  border-color: var(--other-color);
  background-color: rgba(142, 142, 147, 0.1);
}

.operation-type-icon {
  font-size: 20px;
  font-weight: bold;
}

.operation-type-label {
  font-size: 12px;
  text-align: center;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.category-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--background-color);
}

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

.category-option.selected {
  border-color: var(--primary-color);
  background-color: rgba(0, 122, 255, 0.1);
}

.category-icon {
  font-size: 20px;
}

.category-label {
  font-size: 12px;
  text-align: center;
}

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

.cancel-btn,
.save-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;
}

.save-btn:disabled {
  background-color: var(--border-color);
  cursor: not-allowed;
}

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

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

/* Header Add Button */
.header-add-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.header-add-btn:hover {
  background-color: var(--surface-color);
}

/* Section Add Button */
.section-add-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.section-add-btn:hover {
  background-color: var(--surface-color);
}

/* Remove old button styles */
.add-card-btn {
  display: none;
}

.quick-actions {
  display: none;
}

/* Bank-specific styles */
.card-sberbank {
  background: linear-gradient(135deg, #21a038, #1a7a2d);
}
.card-sberbank .card-bank-logo::before {
  content: "СБ";
}

.card-tinkoff {
  background: linear-gradient(135deg, #ffdd2d, #fcc521);
  color: #333;
}
.card-tinkoff .card-bank-logo::before {
  content: "ТК";
}

.card-alfa {
  background: linear-gradient(135deg, #ef3124, #cc1f14);
}
.card-alfa .card-bank-logo::before {
  content: "АБ";
}

.card-vtb {
  background: linear-gradient(135deg, #1946a0, #143a8c);
}
.card-vtb .card-bank-logo::before {
  content: "ВТ";
}

.card-gazprom {
  background: linear-gradient(135deg, #2d6f28, #1e4d1a);
}
.card-gazprom .card-bank-logo::before {
  content: "ГП";
}

.card-sovcom {
  background: linear-gradient(135deg, #ff6b35, #e55a2b);
}
.card-sovcom .card-bank-logo::before {
  content: "СК";
}

.card-rshb {
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
}
.card-rshb .card-bank-logo::before {
  content: "РХ";
}

.card-otkritie {
  background: linear-gradient(135deg, #0047bb, #003399);
}
.card-otkritie .card-bank-logo::before {
  content: "ОТ";
}

.card-raiffeisen {
  background: linear-gradient(135deg, #ff6600, #cc5200);
}
.card-raiffeisen .card-bank-logo::before {
  content: "РА";
}

.card-other {
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.card-other .card-bank-logo::before {
  content: "БК";
}

/* Стили для действий с операциями - ИСПРАВЛЕННЫЕ */
.transaction-actions {
  display: flex;
  gap: 8px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.transaction-action-btn {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--surface-color);
}

.transaction-action-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.transaction-action-btn.edit-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

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

.transaction-item:hover {
  background-color: var(--surface-color);
}

/* Для мобильных устройств - показываем действия при свайпе */
.transaction-item.swipe-actions .transaction-actions {
  opacity: 1;
}

.transaction-item.show-actions .transaction-actions {
  opacity: 1;
}

/* Улучшенные стили для модальных окон редактирования */
.edit-operation-type-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--background-color);
}

.edit-operation-type-btn:hover {
  background-color: var(--surface-color);
}

.edit-operation-type-btn.selected {
  border-color: var(--primary-color);
  background-color: rgba(0, 122, 255, 0.1);
}

.edit-operation-type-btn.income.selected {
  border-color: var(--income-color);
  background-color: rgba(52, 199, 89, 0.1);
}

.edit-operation-type-btn.expense.selected {
  border-color: var(--expense-color);
  background-color: rgba(255, 59, 48, 0.1);
}

.edit-operation-type-btn.other.selected {
  border-color: var(--other-color);
  background-color: rgba(142, 142, 147, 0.1);
}

/* === AI iOS Style Modals === */
.ios-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
}

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

.ios-modal-content {
  background: var(--surface-color);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

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

.ios-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

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

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

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

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

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

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

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

.ios-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* AI Loading State */
.ai-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.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;
}

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

/* AI Result Text */
.ai-result-text {
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-line;
}

.ai-result-text ul {
  margin: 8px 0;
  padding-left: 20px;
}

.ai-result-text li {
  margin: 4px 0;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-ai-btn {
  background: rgba(0, 122, 255, 0.1);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

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

/* Стили для информации о лимитах - ИСПРАВЛЕННЫЕ */
.limit-info-message {
  background-color: var(--surface-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.limit-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 14px;
}

.limit-icon {
  font-size: 20px;
  flex-shrink: 0;
  color: var(--primary-color);
}

.limit-text {
  flex: 1;
  line-height: 1.4;
}

.premium-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}

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

/* Стили для кнопки с требованием Premium */
.action-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background-color: var(--border-color);
  color: var(--text-secondary);
}

/* Адаптация security notice для Premium */
.security-notice.premium-active {
  background-color: rgba(52, 199, 89, 0.1);
  border: 1px solid rgba(52, 199, 89, 0.3);
}

/* Стили для кнопки Premium в iOS стиле */
.premium-action-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

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

.premium-action-btn:disabled {
  background-color: var(--border-color);
  color: var(--text-secondary);
  cursor: not-allowed;
}

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

.feature-locked::after {
  content: "🔒";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
}

/* Стили для логотипа как в 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;
}

/* Стили для иконки AI в кнопке анализа */
.ai-logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: bold;
  margin-right: 6px;
}

/* Скелетон загрузки */
.skeleton-card {
  border-radius: 16px;
  padding: 20px;
  background: var(--surface-color);
  min-height: 180px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-transaction {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  animation: pulse 1.5s ease-in-out infinite;
  background-color: var(--background-color);
}

.skeleton-line {
  height: 12px;
  background: var(--border-color);
  border-radius: 6px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 20px;
  width: 60%;
}

.skeleton-text {
  width: 80%;
}

.skeleton-number {
  height: 24px;
  width: 70%;
}

.skeleton-short {
  width: 40%;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Мобильная адаптация - ИСПРАВЛЕННАЯ */
.mobile-view .transaction-item {
  padding: 12px;
  position: relative;
}

.mobile-view .transaction-actions {
  position: static;
  opacity: 1;
  display: flex;
  gap: 4px;
}

.mobile-view .transaction-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: var(--surface-color);
}

/* Улучшенные стили для мобильных */
@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }

  .header {
    padding: 8px 12px;
  }

  .card-item {
    min-height: 160px;
    padding: 16px;
  }

  .transaction-item {
    padding: 12px 8px;
  }

  .transaction-meta {
    flex-wrap: wrap;
    gap: 6px;
  }

  .transaction-meta span {
    font-size: 12px;
  }

  /* Security Notice - ИСПРАВЛЕНИЕ: показываем на мобильных */
  .security-notice {
    display: flex !important;
    margin-top: 16px;
    padding: 12px;
  }

  .security-text {
    font-size: 13px;
    line-height: 1.3;
  }

  .header-ai-btn span {
    display: inline;
  }

  /* Header Add Button - ИСПРАВЛЕНИЕ: правильное расположение */
  .header-add-btn {
    font-size: 14px;
    padding: 6px 10px;
    white-space: nowrap;
  }

  /* Section Add Button - ИСПРАВЛЕНИЕ */
  .section-add-btn {
    font-size: 13px;
    padding: 5px 8px;
  }

  /* Transaction Actions - ИСПРАВЛЕНИЕ: всегда показываем на мобильных */
  .transaction-actions {
    opacity: 1;
    position: static;
    background: none;
    padding: 0;
    display: flex;
    gap: 4px;
  }

  .transaction-action-btn {
    width: 32px;
    height: 32px;
    background-color: var(--surface-color);
  }
}

@media (max-width: 480px) {
  .card-item {
    min-height: 140px;
    padding: 12px;
  }

  .card-number {
    font-size: 16px;
  }

  .transaction-description {
    font-size: 14px;
  }

  .transaction-amount {
    font-size: 14px;
  }

  .modal {
    width: 95vw;
    max-width: 95vw;
  }

  .security-notice {
    padding: 10px;
  }

  .security-text {
    font-size: 12px;
  }

  /* Header Add Button - дополнительное исправление для очень маленьких экранов */
  .header-add-btn {
    font-size: 12px;
    padding: 5px 8px;
  }

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

  .app-title .logo {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }

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

/* Улучшенные стили для действий */
.transaction-actions {
  display: flex;
  gap: 4px;
}

.transaction-action-btn {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.transaction-action-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Оптимизация анимаций */
.modal {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card-item {
  transition: transform 0.2s ease;
}

.card-item:hover {
  transform: translateY(-2px);
}

/* Улучшенная доступность */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Дополнительные исправления для правильного отображения */
.transaction-item {
  box-shadow: none !important;
  background-color: var(--background-color) !important;
}

.transactions-list {
  box-shadow: none;
  background-color: var(--background-color);
}

/* Исправление для кнопки "Требуется Premium" */
.action-button:disabled .action-label {
  color: var(--text-secondary);
}

/* Исправление позиционирования элементов в header */
.section-header {
  align-items: center;
}

.header-actions {
  align-items: center;
}
