/* Modern CSS Reset & Variables */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-50: #eef2ff;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-link i {
  font-size: 1.5rem;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Language Selector */
.language-selector {
  position: relative;
  display: inline-block;
}

.language-btn {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.language-btn:hover {
  border-color: var(--primary);
  background: var(--gray-50);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 120px;
  z-index: 1001;
  display: none;
}

.language-dropdown.show {
  display: block;
}

.language-dropdown a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.2s ease;
  font-size: 0.9rem;
}

.language-dropdown a:hover {
  background: var(--gray-50);
}

.language-dropdown a.active {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 500;
}

.navbar-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 0.4rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  white-space: nowrap;
  font-size: 1rem;
}

.navbar-links a:hover {
  background: var(--gray-100);
  color: var(--primary);
}

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

.auth-btn.primary:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

.settings-header .user-info {
  background: transparent;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  color: white;
  font-size: 1.25rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
}

.user-plan {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.budget-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 500;
}

.logout-btn {
  color: var(--danger) !important;
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.navbar-toggle:hover {
  background: var(--gray-50);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Ensure hamburger is visible at all mobile breakpoints */
@media (max-width: 1200px) {
  .navbar-toggle {
    display: flex;
    background: var(--white);
    border: 2px solid var(--gray-200);
  }
  
  .navbar-toggle:hover {
    background: var(--gray-50);
    border-color: var(--primary);
  }
}

.navbar-toggle .bar {
  width: 22px;
  height: 3px;
  background: var(--gray-700);
  margin: 2px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.navbar-toggle:hover .bar {
  background: var(--primary);
}

/* Hamburger animation */
.menu-open .navbar-toggle .bar:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-open .navbar-toggle .bar:nth-child(2) {
  opacity: 0;
}

.menu-open .navbar-toggle .bar:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile menu styles */
@media (max-width: 1200px) {
  .navbar-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 0 2rem 0;
    transform: translateY(-100vh);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 40;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .navbar-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .navbar-links a {
    padding: 1rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--gray-100);
    justify-content: flex-start;
    font-size: 1rem;
  }

  .navbar-links a:last-child {
    border-bottom: none;
  }

  /* Hide desktop dropdown on mobile */
  .navbar-links .dropdown {
    display: none;
  }

  /* Mobile sheets grid */
  .mobile-sheets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    width: 100%;
    padding: 0 0.5rem;
  }

  .mobile-sheet-tile {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 0.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-sheet-tile:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
  }



  .mobile-sheet-tile.current-month {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
  }

  .mobile-sheet-tile.current-month:hover {
    background: var(--primary-dark);
  }

  .mobile-year-tile {
    background: var(--success);
    color: white !important;
    border-color: var(--success);
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .mobile-year-tile:hover {
    background: #059669;
    color: white !important;
  }

  /* Mobile sheets section */
  .mobile-sheets-section {
    padding: 1rem 1.5rem 4rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 3rem;
  }

  .mobile-sheets-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1rem;
    font-size: 1rem;
  }

  .mobile-sheets-header i {
    color: var(--primary);
  }

  /* Show mobile sheets section only on mobile */
  .mobile-sheets-section {
    display: block;
  }

  /* Mobile user section */
  .mobile-user-section {
    display: block;
  }

  .mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
  }

  .mobile-user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
  }

  .mobile-user-details {
    flex: 1;
  }

  .mobile-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800);
    display: block;
  }

  .mobile-user-plan {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mobile-user-actions {
    display: block;
  }

  .mobile-user-actions a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.2s;
  }

  .mobile-user-actions a:hover {
    background: var(--gray-50);
  }

  .mobile-user-actions a.logout {
    color: var(--danger);
  }

  .mobile-user-actions a:last-child {
    border-bottom: none;
  }

  /* Mobile language selector */
  .mobile-language-selector {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
  }

  .language-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
  }

  .language-options {
    display: flex;
    gap: 0.5rem;
  }

  .language-options a {
    padding: 0.5rem 1rem !important;
    background: var(--gray-100);
    border-radius: var(--radius);
    color: var(--gray-700) !important;
    text-decoration: none;
    font-size: 0.875rem;
    border-bottom: none !important;
    transition: all 0.2s;
  }

  .language-options a.active {
    background: var(--primary);
    color: white !important;
  }

  .language-options a:hover {
    background: var(--primary-dark);
    color: white !important;
  }

  /* Hide desktop user dropdown on mobile */
  #navbarAuthLinks {
    display: none !important;
  }

  .navbar-toggle {
    display: flex;
  }

  .nav-text {
    display: inline;
  }
}

/* Desktop dropdown styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 1000;
  display: none;
}

.dropdown:hover .dropdown-content,
.dropdown.open .dropdown-content {
  display: block;
}

.dropdown-content a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.2s ease;
  font-size: 0.9rem;
}

.dropdown-content a:hover {
  background: var(--gray-50);
}

.dropdown-content a.current-month {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 500;
}

.dropdown-content a.year-link {
  border-top: 1px solid var(--gray-200);
  background: var(--success);
  color: var(--white);
  font-weight: 600;
}

.dropdown-content a.year-link:hover {
  background: #059669;
}

/* Hide mobile sections on desktop */
@media (min-width: 1200px) {
  .mobile-user-section,
  .mobile-sheets-section {
    display: none;
  }
}

/* Main Content */
.content {
  flex: 1;
  padding: 90px 1.5rem 80px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Cards & Containers */
.container {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; color: var(--gray-800); }
h2 { font-size: 1.875rem; color: var(--gray-700); }
h3 { font-size: 1.5rem; color: var(--gray-700); }

/* Buttons */
.btn, .add-button, .action-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.btn, .add-button {
  background: var(--primary);
  color: var(--white);
}

.btn:hover, .add-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.action-button {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.action-button:hover {
  background: var(--gray-200);
}

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

.action-button.purple-button:hover {
  background: var(--primary-dark);
}

.action-button.green {
  background: var(--success);
  color: var(--white);
}

.action-button.green:hover {
  background: #059669;
}

.action-button.red {
  background: var(--danger);
  color: white;
}

.action-button.red:hover {
  background: #dc2626;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastSlideIn 0.3s ease-out;
  position: relative;
}

.toast.info {
  background: #dbeafe;
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

.toast.success {
  background: #dcfce7;
  border-left: 4px solid var(--success);
  color: #166534;
}

.toast.warning {
  background: #fef3c7;
  border-left: 4px solid var(--warning);
  color: #92400e;
}

.toast.error {
  background: #fee2e2;
  border-left: 4px solid var(--danger);
  color: #991b1b;
}

.toast.confirm {
  background: #fef3c7;
  border-left: 4px solid var(--warning);
  color: #92400e;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.toast-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

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

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

.btn.danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn.danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}

.category-table, .sheets-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.table-header {
  background: var(--gray-50);
}

.table-header .table-cell {
  padding: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
  text-align: left;
  border-left: none;
  border-right: none;
}

.table-cell, .table-cell-2 {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  border-left: none;
  border-right: none;
  vertical-align: middle;
}

.table-cell-2 {
  text-align: center;
}

.category-row {
  background: var(--gray-50);
}

.subcategory-row {
  background: var(--white);
}

.category-row:hover, .subcategory-row:hover {
  background: var(--gray-100);
}

/* Forms */
.input-field, .input-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.input-field:focus, .input-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

/* Status Colors */
.text-green { color: var(--success); font-weight: 600; }
.text-red { color: var(--danger); font-weight: 600; }
.important-variable { color: var(--primary); font-weight: 600; }

/* Dark mode status colors */
body.dark-mode .text-green { color: #34d399 !important; }
body.dark-mode .text-red { color: #f87171 !important; }
body.dark-mode .positive { color: #34d399 !important; }
body.dark-mode .negative { color: #f87171 !important; }
body.dark-mode .table-cell-2.text-green { color: #34d399 !important; }
body.dark-mode .table-cell-2.text-red { color: #f87171 !important; }
body.dark-mode .diff.positive { color: #34d399 !important; }
body.dark-mode .diff.negative { color: #f87171 !important; }

/* Modals */
.modal, .modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-overlay {
  display: flex;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  padding: 0;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1.5rem 2rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  color: white;
  line-height: 1.3;
  word-wrap: break-word;
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}



.close-button {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* Modal escape key handling */

.modal-submit-button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-submit-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal .form-group label {
  font-weight: 500;
  color: var(--gray-700);
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

/* Ensure all modal text on colored backgrounds is light */
.modal-header,
.modal-header h1,
.modal-header h2,
.modal-header h3,
.modal-header h4,
.modal-header h5,
.modal-header h6,
.modal-header p,
.modal-header span {
  color: white !important;
}

/* Summary Cards */
.sheets-summary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.summary-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
}

.summary-column-planned, .summary-column-actual {
  text-align: center;
}

.summary-column-planned h3, .summary-column-actual h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.summary-column-planned p, .summary-column-actual p {
  font-size: 1rem;
  margin: 0.5rem 0;
}

.summary-title {
  color: var(--white);
  text-align: center;
  margin-bottom: 1rem;
}

/* Progress Bar */
.progress-container {
  margin: 2rem 0;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--secondary));
  border-radius: 4px;
  transition: width 0.3s ease;
  min-width: 0;
}

.progress-fill[style*="width: 0%"] {
  display: none;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 1rem;
  text-align: center;
}

/* Mobile footer - not fixed */
@media (max-width: 1200px) {
  .footer {
    position: static;
    margin-top: 2rem;
  }
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
}

.footer p {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-left: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--gray-600) !important;
  text-decoration: none !important;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary) !important;
}

.footer-links a i {
  margin-right: 0.25rem;
}

/* Utility Classes */
.d-none { display: none; }
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 10;
}

.dropdown-content a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.2s;
}

.dropdown-content a:hover {
  background: var(--gray-100);
}

.dropdown-content a.current-month {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.dropdown-content a.current-month:hover {
  background: var(--primary-dark);
  color: white;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Bulk Add Modal Styles */
.bulk-add-container {
    max-width: 100%;
}

.bulk-add-header {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.bulk-table-container {
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    max-height: 400px;
    overflow-y: auto;
}

.bulk-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    min-width: 800px;
}

.bulk-table th {
    background: var(--gray-50);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.bulk-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.bulk-table th:last-child {
    text-align: center;
}

.bulk-table td:last-child {
    text-align: center;
    vertical-align: middle;
}

.bulk-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.bulk-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.bulk-input:invalid {
    border-color: var(--danger);
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.btn.secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn.secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
}

#bulkAddModal .modal-content {
    max-width: 1200px;
    width: 95%;
}

#bulkAddModal .modal-body {
    max-height: calc(90vh - 200px);
}

.recent-items-modal {
    max-width: 1400px;
    width: 95%;
}

.recent-items-modal .modal-body {
    max-height: calc(80vh - 150px);
}

.recent-items-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    table-layout: fixed;
}

.recent-items-table th:nth-child(1),
.recent-items-table td:nth-child(1) {
    width: 5%;
}

.recent-items-table th:nth-child(2),
.recent-items-table td:nth-child(2) {
    width: 5%;
}

.recent-items-table th:nth-child(3),
.recent-items-table td:nth-child(3) {
    width: 16%;
}

.recent-items-table th:nth-child(4),
.recent-items-table td:nth-child(4) {
    width: 10%;
}

.recent-items-table th:nth-child(5),
.recent-items-table td:nth-child(5) {
    width: 12%;
}

.recent-items-table th:nth-child(6),
.recent-items-table td:nth-child(6) {
    width: 12%;
}

.recent-items-table th:nth-child(7),
.recent-items-table td:nth-child(7) {
    width: 15%;
}

.recent-items-table th:nth-child(8),
.recent-items-table td:nth-child(8) {
    width: 15%;
}

.recent-items-table th,
.recent-items-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
}

.recent-items-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    position: sticky;
    top: 0;
}

.recent-items-table tr:hover {
    background: var(--gray-50);
}

@media (max-width: 1200px) {
    .recent-items-modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .recent-items-modal .modal-body {
        max-height: calc(100vh - 150px);
    }
    
    .recent-items-table {
        font-size: 0.8rem;
    }
    
    .recent-items-table th,
    .recent-items-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .recent-items-container .table-wrapper {
        overflow-x: auto;
    }
    
    .recent-items-table {
        min-width: 600px;
    }
}

#bulkAddModal .footer-left {
    flex: 1;
    justify-content: flex-start;
}

#bulkAddModal .footer-right {
    justify-content: flex-end;
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastSlideIn 0.3s ease-out;
    position: relative;
    pointer-events: auto;
}

.toast.info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.toast.success {
    background: #dcfce7;
    border-left: 4px solid var(--success);
    color: #166534;
}

.toast.warning {
    background: #fef3c7;
    border-left: 4px solid var(--warning);
    color: #92400e;
}

.toast.error {
    background: #fee2e2;
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}



.confirm-toast {
    min-width: 350px;
}

.toast-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.toast-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.toast-btn.confirm-btn {
    background: var(--success) !important;
    color: white !important;
}

.toast-btn.confirm-btn:hover {
    background: #059669 !important;
}

.toast-btn.cancel-btn {
    background: var(--danger) !important;
    color: white !important;
}

.toast-btn.cancel-btn:hover {
    background: #dc2626 !important;
}

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

/* Register Actions */
.register-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

.register-actions .btn {
    flex: 1;
}

/* Dark Mode */
body.dark-mode {
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-300: #6b7280;
    --gray-400: #9ca3af;
    --gray-500: #d1d5db;
    --gray-600: #e5e7eb;
    --gray-700: #f3f4f6;
    --gray-800: #f9fafb;
    --gray-900: #ffffff;
    --white: #1f2937;
    background: #111827;
    color: #f9fafb;
}

body.dark-mode .header {
    background: #1f2937;
    border-bottom-color: #374151;
}

body.dark-mode .footer {
    background: #1f2937;
    border-top-color: #374151;
}

body.dark-mode .container {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .modal-content {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .toast {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

/* Responsive Navigation */
@media (max-width: 1320px) {
  .navbar-links .nav-text {
    display: none;
  }
  
  .navbar-links a {
    padding: 0.5rem;
    min-width: 40px;
    text-align: center;
    justify-content: center;
  }
  
  .navbar-links a i {
    margin: 0;
  }
}

/* Mobile toast positioning - center with 95% width */
@media (max-width: 768px) {
    .toast-container {
        position: fixed !important;
        top: 20px !important;
        left: 2.5% !important;
        right: 2.5% !important;
        width: 95% !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        z-index: 10000 !important;
    }
    
    .toast {
        width: 100% !important;
        min-width: auto !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        box-sizing: border-box !important;
    }
    
    .confirm-toast {
        min-width: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .toast-actions {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        margin-top: 0.75rem !important;
    }
    
    .toast-btn {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem !important;
        white-space: nowrap !important;
    }
    
    .toast-content {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Hide modal close button on mobile */
    .modal-close,
    .close-btn,
    .btn-close,
    .close-button {
        display: none !important;
    }
    
    /* Round modal headers on mobile */
    .modal-header {
        border-radius: var(--radius) var(--radius) 0 0;
    }
}

/* ===== MOBILE COOKIES MODAL FIXES ===== */
@media (max-width: 480px) {
  /* Fix cookies modal layout on mobile */
  .cookies-modal-content {
    margin: 0 !important;
    width: 95% !important;
    max-width: 95% !important;
    height: 80vh !important;
    max-height: 80vh !important;
    border-radius: var(--radius-lg) !important;
  }
  
  .cookies-modal-header {
    padding: 1rem 1.5rem !important;
    border-radius: 0 !important;
  }
  
  .cookies-modal-body {
    padding: 1.5rem !important;
    max-height: calc(80vh - 160px) !important;
  }
  
  .cookies-category-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    padding: 1rem !important;
  }
  
  .cookies-category-info {
    width: 100% !important;
  }
  
  .cookies-toggle {
    align-self: flex-end !important;
    width: auto !important;
  }
  
  .toggle-label {
    width: 50px !important;
    height: 25px !important;
  }
  
  .toggle-slider:before {
    height: 19px !important;
    width: 19px !important;
    left: 3px !important;
    bottom: 3px !important;
  }
  
  input:checked + .toggle-label .toggle-slider:before {
    transform: translateX(25px) !important;
  }
  
  .cookies-modal-footer {
    padding: 1rem 1.5rem !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .cookies-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px 20px !important;
  }
}

/* ===== MOBILE 2FA VERIFICATION FIXES ===== */
@media (max-width: 480px) {
  /* Fix 2FA verification email wrapping */
  .verify-header p {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    line-height: 1.6 !important;
  }
  
  .verify-header strong {
    word-break: break-all !important;
    display: block !important;
    margin-top: 0.5rem !important;
  }
  
  /* 2FA setup page mobile fixes */
  .qr-header p,
  .verification-header p {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
}

/* ===== MOBILE SECURITY SETTINGS FIXES ===== */
@media (max-width: 480px) {
  /* Fix 2FA buttons to be equal width */
  .security-actions {
    gap: 0.75rem !important;
    width: 100% !important;
  }
  
  .security-actions .btn-secondary,
  .security-actions .btn-danger {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.85rem !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* Fix active sessions layout */
  .session-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    padding: 1rem !important;
  }
  
  .session-info {
    width: 100% !important;
  }
  
  .session-device {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
  
  .session-details {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.25rem !important;
  }
  
  .session-actions {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }
  
  .btn-terminate {
    width: 100% !important;
    max-width: 200px !important;
    justify-content: center !important;
  }
  
  /* Hide bullet points in session details on mobile */
  .session-details span:nth-child(2),
  .session-details span:nth-child(4) {
    display: none !important;
  }
  
  /* Display session device title next to icon on mobile */
  .session-device {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
  }
}

/* ===== MOBILE PREFERENCES SETTINGS FIXES ===== */
@media (max-width: 480px) {
  /* Fix preferences form button to full width */
  .form-actions {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .form-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 1rem 1.5rem !important;
  }
  
  /* Fix preference items layout */
  .preference-item,
  .notification-item,
  .display-item,
  .privacy-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    text-align: left !important;
  }
  

  
  .preference-header,
  .notification-header,
  .display-header,
  .privacy-header {
    width: 100% !important;
  }
  
  .preference-control,
  .notification-control,
  .display-control,
  .privacy-control {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
  }
  

  
  .preference-select {
    width: 100% !important;
    min-width: auto !important;
  }
  
  /* Fix security settings buttons to full width */
  .security-btn,
  a.security-btn {
    width: 100% !important;
    min-width: auto !important;
  }
  
  /* Fix all form action buttons to full width */
  .form-actions .btn {
    width: 100% !important;
  }
  
  /* Fix profile settings buttons to full width */
  button[name="change_email"] {
    width: 100% !important;
    justify-content: center !important;
  }
  
  /* Make preference toggles identical to cookies modal */
  .preference-control .toggle-label,
  .notification-control .toggle-label,
  .display-control .toggle-label,
  .privacy-control .toggle-label {
    width: 60px !important;
    height: 30px !important;
  }
  
  .preference-control .toggle-slider,
  .notification-control .toggle-slider,
  .display-control .toggle-slider,
  .privacy-control .toggle-slider {
    background: var(--gray-300) !important;
    border-radius: 30px !important;
  }
  
  .preference-control .toggle-slider:before,
  .notification-control .toggle-slider:before,
  .display-control .toggle-slider:before,
  .privacy-control .toggle-slider:before {
    height: 24px !important;
    width: 24px !important;
    left: 3px !important;
    top: 3px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  }
  
  .preference-control input:checked + .toggle-label .toggle-slider,
  .notification-control input:checked + .toggle-label .toggle-slider,
  .display-control input:checked + .toggle-label .toggle-slider,
  .privacy-control input:checked + .toggle-label .toggle-slider {
    background-color: #10b981 !important;
    background: #10b981 !important;
  }
  
  .preference-control input:checked + .toggle-label .toggle-slider:before,
  .notification-control input:checked + .toggle-label .toggle-slider:before,
  .display-control input:checked + .toggle-label .toggle-slider:before,
  .privacy-control input:checked + .toggle-label .toggle-slider:before {
    transform: translateX(30px) !important;
  }
  
  /* Direct styles for toggle-switch class used in preferences HTML */
  .toggle-switch input:checked + .toggle-slider {
    background-color: #10b981 !important;
    background: #10b981 !important;
  }
}

/* Alert layout fix - remove flex, center icon and text */
.alert {
    display: block;
    position: relative;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.alert-danger {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    border: 1px solid #10b981;
    color: #166534;
}

.alert i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

.alert-content {
    text-align: center;
}

.alert-content h4,
.alert-content p {
    text-align: center !important;
    margin: 0;
}

.alert-content h4 {
    margin-bottom: 0.5rem;
}

/* Mobile category toggle - prevent scroll from closing subcategories */
.mobile-category-toggle {
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    position: relative;
    touch-action: manipulation;
    user-select: none;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s ease !important;
    color: var(--primary) !important;
    flex-shrink: 0 !important;
    margin-right: 0.5rem !important;
    vertical-align: middle !important;
}

.mobile-category-toggle:hover {
    color: var(--primary-dark) !important;
    transform: scale(1.1) !important;
}

.mobile-category-toggle.rotated {
    transform: rotate(180deg) !important;
}

.category-toggle {
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s ease !important;
    margin-right: 0.5rem !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    color: var(--primary) !important;
    flex-shrink: 0 !important;
}

.category-toggle:hover {
    color: var(--primary-dark) !important;
    transform: scale(1.1) !important;
}

.category-toggle.rotated {
    transform: rotate(180deg) !important;
}

.category-toggle.rotated:hover {
    transform: rotate(180deg) scale(1.1) !important;
}

.mobile-category-header {
    position: relative;
    touch-action: manipulation;
    user-select: none;
}

/* Step layout fix for mobile - center number above content */
@media (max-width: 480px) {
    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .step-number {
        align-self: center;
        margin-bottom: 0.5rem;
        flex-shrink: 0;
    }
    
    .step-content {
        text-align: center;
        width: 100%;
    }
    
    .step-content h3 {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .step-content ul {
        text-align: left;
        max-width: 100%;
        margin: 0 auto;
    }
}

/* Mobile Responsive */
@media (max-width: 1200px) {
  .navbar {
    padding: 0 1rem;
    height: 70px;
  }

  .navbar-brand {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .navbar-toggle {
    display: flex;
  }

  .navbar-links {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem 0 1rem 0;
    gap: 0.5rem;
    z-index: 40;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .navbar-links.active {
    display: flex;
  }

  .navbar-links .nav-text {
    display: inline;
  }

  .navbar-links a {
    padding: 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    text-align: left;
    min-width: auto;
  }

  .navbar-links a:hover {
    background: var(--gray-100);
    transform: translateX(4px);
  }

  #navbarAuthLinks {
    display: none;
    position: absolute;
    top: calc(70px + 200px);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    z-index: 39;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  }

  #navbarAuthLinks.active {
    display: flex;
  }

  .user-info {
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin: 0.25rem 0;
  }

  .auth-btn {
    justify-content: center;
    padding: 1rem;
    font-weight: 600;
  }

  .auth-btn.primary {
    background: var(--primary);
    color: white;
    margin-top: 0.5rem;
  }

  .logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger) !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-top: 0.5rem;
  }

  /* Dropdown styling for mobile */
  .dropdown {
    position: relative;
  }

  .dropdown > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }

  .dropdown > a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: transform 0.2s;
  }

  .dropdown.open > a::after {
    transform: rotate(180deg);
  }

  .dropdown-content {
    display: none;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin: 0.5rem 0;
    padding: 0.5rem;
    text-align: center;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
  }

  .dropdown.open .dropdown-content {
    display: block;
  }

  .dropdown-content a {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--gray-600);
    border-radius: var(--radius);
    display: block;
    pointer-events: auto;
  }

  .dropdown-content a:hover {
    background: var(--gray-100);
    color: var(--primary);
  }

  .dropdown-content a:active {
    background: var(--primary);
    color: white;
  }
  
  .dropdown-content a.current-month {
    background: var(--primary);
    color: white;
    font-weight: 600;
  }
  
  .dropdown-content a.current-month:hover {
    background: var(--primary-dark);
    color: white;
  }

  .content {
    padding: 90px 0rem 1rem;
  }

  .container {
    padding: 1.5rem;
  }

  .summary-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .table-wrapper {
    font-size: 0.875rem;
  }

  .table-cell, .table-cell-2 {
    padding: 0.75rem 0.5rem;
  }

  .modal-content {
    width: 95%;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .footer-links {
    margin-left: 0;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .footer-links a {
    font-size: 0.8rem;
  }

  /* ===== MOBILE CATEGORIES TABLE ===== */
  .category-table {
    display: block;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .category-table thead {
    display: none;
  }

  .category-table tbody {
    display: block;
  }

  .category-table tr {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
  }

  .category-table tr:hover {
    background: var(--gray-50);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
  }

  .category-table td {
    display: block;
    border: none;
    padding: 0.5rem 0;
    text-align: left !important;
  }

  .category-table td:before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-600);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Category row styling */
  .category-row {
    background: linear-gradient(135deg, var(--primary-50), var(--gray-50)) !important;
    border-left: 4px solid var(--primary) !important;
  }

  .category-row:hover {
    background: linear-gradient(135deg, var(--primary-50), var(--gray-100)) !important;
  }

  /* Subcategory row styling */
  .subcategory-row {
    background: var(--white) !important;
    border-left: 4px solid var(--gray-300) !important;
    margin-left: 1rem;
    margin-top: 0.5rem;
  }

  .subcategory-add-row {
    background: var(--gray-50) !important;
    border-left: 4px solid var(--success) !important;
    margin-left: 1rem;
    margin-top: 0.5rem;
  }

  .category-add-row {
    background: linear-gradient(135deg, var(--success), #059669) !important;
    color: white;
    border-left: 4px solid var(--success) !important;
  }

  .category-add-row td:before {
    color: rgba(255, 255, 255, 0.8) !important;
  }

  .category-add-row .input-field,
  .category-add-row .input-select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--gray-800);
  }

  /* Mobile action buttons */
  .mobile-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
  }

  .action-button {
    flex: 1;
    min-width: 80px;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    text-align: center;
    justify-content: center;
  }
  
  .action-button i {
    font-size: 0.7rem !important;
  }

  /* Hide desktop table labels on mobile */
  .table-cell:first-child:before {
    content: "Nazwa";
  }

  .table-cell-2:nth-child(2):before {
    content: "Typ";
  }

  .table-cell-2:nth-child(3):before {
    content: "Akcje";
  }

  /* ===== MOBILE SHEETS HEADER ===== */
  .header-actions {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .header-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  /* Create two rows of buttons */
  .mobile-header-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .mobile-header-row .btn {
    flex: 1;
    min-width: 0;
  }



  /* Table wrapper mobile */
  .table-wrapper {
    overflow: visible;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  /* Mobile action buttons for sheets */
  .table-wrapper:not(.categories-page) .action-button {
    display: inline-flex;
    margin: 0.25rem 0.25rem 0.25rem 0;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }
  
  .table-wrapper:not(.categories-page) .action-button i {
    font-size: 0.7rem !important;
  }

  /* Summary cards mobile */
  .summary-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .summary-card {
    margin-bottom: 1rem;
  }

  .card-content {
    padding: 1rem;
  }

  .metric {
    padding: 0.5rem 0;
  }

  .metric .label {
    font-size: 0.85rem;
  }

  .metric .value {
    font-size: 1rem;
  }

  /* ===== MOBILE USER PREFERENCES ===== */
  .email-display {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 0.75rem;
  }
  
  .email-display span:first-of-type {
    word-break: break-all;
    font-size: 0.9rem;
  }
  
  .email-status {
    align-self: center;
    margin-left: 0 !important;
    font-size: 0.8rem;
  }
  
  .new-email {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
  
  .new-email .value {
    word-break: break-all;
    width: 100%;
    box-sizing: border-box;
  }
  
  .preference-item,
  .notification-item,
  .display-item,
  .privacy-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    text-align: left !important;
  }
  
  .preference-header,
  .notification-header,
  .display-header,
  .privacy-header {
    width: 100%;
  }
  
  .preference-control,
  .notification-control,
  .display-control,
  .privacy-control {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
  
  .preference-select {
    width: 100%;
    min-width: auto;
  }
  
  .form-grid {
    grid-template-columns: 1fr !important;
  }
  
  .avatar-section {
    flex-direction: column !important;
    text-align: center !important;
  }
  
  .status-steps {
    gap: 0.5rem;
  }
  
  .step {
    font-size: 0.85rem;
  }
  
  .rate-limit-info {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .rate-limit-text {
    text-align: center;
  }
  
}

/* ===== EXTRA SMALL MOBILE (iPhone 16 and similar) ===== */
@media (max-width: 480px) {
  .email-display {
    padding: 0.5rem;
    font-size: 0.85rem;
  }
  
  .email-display i {
    font-size: 0.9rem;
  }
  
  .email-display span:first-of-type {
    font-size: 0.8rem;
    line-height: 1.3;
  }
  
  .email-status {
    font-size: 0.75rem;
  }
  
  .preferences-settings-page,
  .profile-settings-page {
    padding: 0 0.5rem;
  }
  
  .page-header {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .header-text h1 {
    font-size: 1.25rem;
  }
  
  .header-text p {
    font-size: 0.85rem;
  }
  
  .preferences-grid,
  .notifications-grid,
  .display-grid,
  .privacy-grid {
    padding: 1rem;
    gap: 1rem;
  }
  
  .preference-item,
  .notification-item,
  .display-item,
  .privacy-item {
    padding: 1rem;
  }
  
  .preference-info h4,
  .notification-info h4,
  .display-info h4,
  .privacy-info h4 {
    font-size: 0.9rem;
  }
  
  .preference-info p,
  .notification-info p,
  .display-info p,
  .privacy-info p {
    font-size: 0.8rem;
  }
  
  .section-header {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }
  
  .section-title h3 {
    font-size: 1rem;
  }
  
  .section-title p {
    font-size: 0.8rem;
  }
  
  .form-actions {
    padding: 1rem;
    flex-direction: column;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .new-email .value {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
  
  .email-change-container {
    padding: 1rem;
  }
  
  .current-email {
    margin: 1rem 0;
  }
  
  .email-change-status {
    padding: 1rem;
  }
  
  .status-header h4 {
    font-size: 0.9rem;
  }
  
  .avatar-circle {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .avatar-upload-btn {
    width: 25px;
    height: 25px;
    font-size: 0.7rem;
  }
  
  .form-section {
    padding: 1rem;
  }
  
  .form-group input,
  .form-group select {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .form-group label {
    font-size: 0.85rem;
  }
  
  .input-help {
    font-size: 0.75rem;
  }
  
  .toggle-switch {
    width: 50px;
    height: 25px;
  }
  
  .toggle-slider:before {
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
  }
  
  input:checked + .toggle-slider:before {
    transform: translateX(25px);
  }
  
  .rate-limit-info {
    padding: 0.75rem;
  }
  
  .rate-limit-text {
    font-size: 0.8rem;
  }
  
  .info-steps h4 {
    font-size: 0.9rem;
  }
  
  .info-steps li {
    font-size: 0.8rem;
  }

  /* ===== MOBILE BALANCE PAGE ===== */
  .balance-summary-cards {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  
  .summary-card {
    padding: 1rem;
  }
  
  .card-content h3 {
    font-size: 1.25rem;
  }
  
  .accounts-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    padding: 1rem;
  }
  
  .account-card {
    padding: 1rem;
  }
  
  .account-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .account-balance {
    font-size: 1.25rem;
  }
  
  .account-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .action-btn {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .goal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .goal-actions {
    align-self: flex-end;
  }
  
  .section-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .header-content {
    flex-direction: column !important;
    gap: 1rem;
    text-align: center;
  }
  
  /* Przesuwna tabela rejestru */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .register-table {
    min-width: 600px;
    font-size: 0.85rem;
  }
  
  .register-table th,
  .register-table td {
    padding: 0.5rem;
    white-space: nowrap;
  }
  
  .register-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
  }
  
  .register-actions .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
  
  #balanceRegisterModal .modal-content {
    width: 98%;
    max-width: none;
    margin: 1% auto;
  }
  
  .modal-content {
    width: 95% !important;
    margin: 2% auto;
  }
  
  .form-group {
    padding: 0 1rem;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== EXTRA SMALL MOBILE BALANCE (iPhone 16 and similar) ===== */
@media (max-width: 480px) {
  .summary-card {
    padding: 0.75rem;
  }
  
  .card-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
  
  .card-content h3 {
    font-size: 1.1rem;
  }
  
  .card-content p {
    font-size: 0.85rem;
  }
  
  .card-detail {
    font-size: 0.75rem;
  }
  
  .account-card {
    padding: 0.75rem;
  }
  
  .account-balance {
    font-size: 1.1rem;
  }
  
  .account-type {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }
  
  .action-btn {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .goal-item {
    margin-bottom: 0.75rem;
  }
  
  .goal-name {
    font-size: 0.9rem;
  }
  
  .goal-progress-text {
    font-size: 0.8rem;
  }
  
  .edit-goal-btn, .delete-goal-btn {
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
  }
  
  .register-table {
    font-size: 0.8rem;
  }
  
  .register-table th,
  .register-table td {
    padding: 0.4rem;
  }
  
  .register-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
  }
  
  .register-actions .btn {
    flex: 1;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .modal-header h3 {
    font-size: 1rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
    padding: 0 0.75rem;
  }
  
  .form-group label {
    font-size: 0.9rem;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  .form-actions {
    padding: 1rem 0.75rem;
  }
  
  .form-actions .btn {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  .empty-state {
    padding: 2rem 1rem;
  }
  
  .empty-icon {
    font-size: 3rem;
  }
  
  .empty-state h3 {
    font-size: 1.1rem;
  }
  
  .empty-state p {
    font-size: 0.9rem;
  }

  /* Progress container mobile */
  .progress-container {
    padding: 1.5rem;
    margin: 1rem 0;
  }

  .progress-header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .progress-percentage {
    font-size: 1.25rem;
  }

  /* AI Assistant mobile */
  .ai-header {
    padding: 1rem;
  }

  .ai-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
  }

  .ai-title h3 {
    font-size: 1.1rem;
  }

  .ai-insights {
    padding: 1rem;
  }

  /* Budget alerts mobile */
  .alert {
    padding: 1rem 1rem 1rem 3rem;
  }

  .alert i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    margin-bottom: 0;
  }

  .alert-content h4 {
    font-size: 1rem;
    text-align: center;
  }

  .alert-content p {
    font-size: 0.875rem;
    text-align: center;
  }

  /* Mobile sheets tables - stack columns vertically */
  .table-wrapper:not(.categories-page) .category-table {
    display: block;
  }
  
  .table-wrapper:not(.categories-page) .category-table thead {
    display: none;
  }
  
  .table-wrapper:not(.categories-page) .category-table tbody {
    display: block;
  }
  
  .table-wrapper:not(.categories-page) .category-table tr {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
  }
  
  .table-wrapper:not(.categories-page) .category-table td {
    display: block;
    border: none;
    padding: 0.5rem 0;
    text-align: left !important;
  }
  
  .table-wrapper:not(.categories-page) .category-table td:before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-600);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
}

/* Document Scanner Styles */
.transaction-summary {
  background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.transaction-summary p {
  margin: 0.75rem 0;
  color: var(--gray-700);
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transaction-summary p strong {
  color: var(--gray-800);
  font-weight: 600;
}

@media (max-width: 480px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  
  .btn, .add-button, .action-button {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  
  .table-cell, .table-cell-2 {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }

  /* Extra small mobile adjustments */
  .container {
    padding: 1rem;
  }

  .header-content {
    padding: 1rem;
  }

  .header-info h1 {
    font-size: 1.25rem;
  }

  .category-table tr {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .action-button {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }

  .mobile-header-row .btn {
    padding: 0.6rem 0.5rem;
    font-size: 0.75rem;
  }

  .summary-card {
    padding: 1rem;
  }

  .card-content {
    padding: 0.75rem;
  }

  .progress-container {
    padding: 1rem;
  }

  .ai-header {
    padding: 0.75rem;
  }

  .ai-insights {
    padding: 0.75rem;
  }
}

/* ===== COOKIES CONSENT STYLES ===== */

/* Banner cookies */
.cookies-banner {
  position: fixed;
  bottom: 120px;
  left: 20px;
  right: 20px;
  background: linear-gradient(135deg, #6366f1, #4f46e5, #4338ca);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 8px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 9999;
  transform: translateY(calc(100% + 40px));
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 1200px;
  margin: 0 auto;
}

.cookies-banner.show {
  transform: translateY(0);
}

.cookies-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.cookies-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  box-shadow: var(--shadow-md);
  animation: cookieFloat 3s ease-in-out infinite;
}

@keyframes cookieFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.cookies-text h3 {
  margin: 0 0 0.5rem 0;
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
}

.cookies-text p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.5;
}

.cookies-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookies-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 12px 24px;
  border: none;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.025em;
}

.cookies-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.cookies-btn:hover::before {
  left: 100%;
}

.cookies-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.15),
    0 6px 12px rgba(0, 0, 0, 0.1);
}

.cookies-btn-accept {
  background: rgba(255, 255, 255, 0.95);
  color: #374151;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cookies-btn-accept:hover {
  background: white;
  border-color: rgba(255, 255, 255, 0.5);
  color: #1f2937;
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.15),
    0 6px 12px rgba(0, 0, 0, 0.1);
}

.cookies-btn-necessary {
  background: rgba(255, 255, 255, 0.95);
  color: #374151;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cookies-btn-necessary:hover {
  background: white;
  border-color: rgba(255, 255, 255, 0.5);
  color: #1f2937;
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.15),
    0 6px 12px rgba(0, 0, 0, 0.1);
}

.cookies-btn-settings {
  background: rgba(255, 255, 255, 0.95);
  color: #374151;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cookies-btn-settings:hover {
  background: white;
  border-color: rgba(255, 255, 255, 0.5);
  color: #1f2937;
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.15),
    0 6px 12px rgba(0, 0, 0, 0.1);
}

.cookies-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.cookies-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.cookies-modal-footer .cookies-btn-accept {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookies-modal-footer .cookies-btn-accept:hover {
  background: white;
  color: var(--primary-dark);
  border-color: white;
}

/* Modal ustawień cookies */
.cookies-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 40px 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cookies-modal.show {
  opacity: 1;
  visibility: visible;
}

.cookies-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
  backdrop-filter: blur(12px) saturate(150%);
}

.cookies-modal-content {
  position: relative;
  background: linear-gradient(135deg, #1f2937, #374151, #4b5563);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.25),
    0 12px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.8) translateY(40px) rotateX(10deg);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.cookies-modal.show .cookies-modal-content {
  transform: scale(1) translateY(0) rotateX(0deg);
}

.cookies-modal-header {
  background: linear-gradient(135deg, #6366f1, #4f46e5, #4338ca);
  color: white;
  padding: 2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.cookies-modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  pointer-events: none;
}

.cookies-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
}

.cookies-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
}

.cookies-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1) rotate(90deg);
}

.cookies-modal-body {
  padding: 2.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
  color: white;
  flex: 1;
}

.cookies-modal-body::-webkit-scrollbar {
  width: 6px;
}

.cookies-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.cookies-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(79, 70, 229, 0.4));
  border-radius: 10px;
}

.cookies-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(79, 70, 229, 0.6));
}

.cookies-category {
  margin-bottom: 1.5rem;
  background: linear-gradient(145deg, rgba(55, 65, 81, 0.8), rgba(75, 85, 99, 0.9));
  border: 1px solid rgba(156, 163, 175, 0.3);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.cookies-category:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.cookies-category-header {
  background: linear-gradient(145deg, rgba(75, 85, 99, 0.9), rgba(107, 114, 128, 0.95));
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.cookies-category-info h4 {
  margin: 0 0 0.5rem 0;
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookies-category-info p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.5;
}

.cookies-toggle {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cookies-toggle input[type="checkbox"] {
  display: none;
}

.toggle-label {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  cursor: pointer;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gray-300);
  border-radius: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-label .toggle-slider {
  background: var(--success);
}

input:checked + .toggle-label .toggle-slider:before {
  transform: translateX(30px);
}

input:disabled + .toggle-label {
  opacity: 0.6;
  cursor: not-allowed;
}

input:disabled + .toggle-label .toggle-slider {
  background: var(--gray-400);
}

.cookies-details {
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(55, 65, 81, 0.7), rgba(75, 85, 99, 0.8));
  border-top: 1px solid rgba(156, 163, 175, 0.2);
}

.cookies-details ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cookies-details li {
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.cookies-details li:before {
  content: "•";
  color: #a5b4fc;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.cookies-details strong {
  color: white;
  font-weight: 600;
}

.cookies-info-section {
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.9), rgba(107, 114, 128, 0.95));
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(156, 163, 175, 0.4);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.cookies-info-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #a5b4fc, #818cf8, #a5b4fc);
  background-size: 200% 100%;
  animation: gradientMove 3s ease-in-out infinite;
}

@keyframes gradientMove {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.cookies-info-section h4 {
  margin: 0 0 1rem 0;
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookies-info-section p {
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  line-height: 1.6;
}

.cookies-info-section a {
  color: #a5b4fc;
  text-decoration: none;
  font-weight: 600;
}

.cookies-info-section a:hover {
  color: #c7d2fe;
  text-decoration: underline;
}

.cookies-modal-footer {
  background: linear-gradient(135deg, #6366f1, #4f46e5, #4338ca);
  padding: 2rem 2.5rem;
  border-top: none;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  backdrop-filter: blur(10px);
}

/* Responsywność dla cookies */
@media (max-width: 1200px) {
  .cookies-banner {
    bottom: 100px;
    left: 10px;
    right: 10px;
    border-radius: 20px;
  }
  
  .cookies-modal {
    padding: 20px 10px 120px 10px;
  }
  
  .cookies-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
    padding: 2rem 1.5rem;
  }

  .cookies-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
    margin: 0 auto;
  }

  .cookies-actions {
    justify-content: center;
    gap: 0.5rem;
  }

  .cookies-btn {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
  }

  .cookies-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .cookies-modal-header {
    padding: 1rem 1.5rem;
  }

  .cookies-modal-header h2 {
    font-size: 1.25rem;
  }

  .cookies-modal-body {
    padding: 1.5rem;
    max-height: 70vh;
  }

  .cookies-category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .cookies-toggle {
    align-self: flex-end;
  }

  .cookies-modal-footer {
    padding: 1rem 1.5rem;
    flex-direction: column;
  }

  .cookies-btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .cookies-banner {
    bottom: 95px;
    left: 8px;
    right: 8px;
  }
  
  .cookies-modal {
    padding: 60px 8px 60px 8px;
  }
  
  .cookies-content {
    padding: 1.5rem 1rem;
  }

  .cookies-text h3 {
    font-size: 1.125rem;
  }

  .cookies-text p {
    font-size: 0.875rem;
  }

  .cookies-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cookies-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }

  .cookies-modal-content {
    margin: 0;
    max-height: 75vh;
    width: calc(100% - 16px);
  }

  .cookies-modal-header {
    padding: 1.5rem;
  }

  .cookies-modal-body {
    padding: 1.5rem;
    max-height: 60vh;
  }

  .cookies-category-header {
    padding: 1.5rem;
  }

  .cookies-details {
    padding: 1.5rem;
  }

  .cookies-info-section {
    padding: 1.5rem;
  }

  .cookies-modal-footer {
    padding: 1.5rem;
    flex-direction: column;
  }
}

/* Demo Banner Styles */
.demo-banner {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 0.75rem 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 999;
}

.demo-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0 1rem;
}

.demo-banner i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.demo-text {
  font-weight: 500;
  font-size: 0.9rem;
  flex: 1;
  text-align: center;
}

.demo-signup-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.demo-signup-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .demo-banner-content {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem;
  }
  
  .demo-text {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .demo-signup-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .demo-banner {
    padding: 1rem 0;
  }
  
  .demo-banner-content {
    gap: 1rem;
  }
  
  .demo-text {
    font-size: 0.8rem;
  }
  
  .demo-signup-btn {
    width: 100%;
    justify-content: center;
    max-width: 200px;
  }
}

/* Demo readonly styles */
.demo-readonly {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed;
}

/* Demo navigation button */
.demo-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.demo-nav-btn:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
  color: white;
}

/* Mobile demo button styling */
@media (max-width: 1200px) {
  .demo-nav-btn:not(.desktop) {
    width: 100%;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    border-radius: 0;
    justify-content: flex-start;
    font-size: 1rem;
    margin: 0;
  }
  
  .demo-nav-btn.desktop {
    display: none;
  }
}

/* Desktop demo button */
@media (min-width: 1200px) {
  .demo-nav-btn:not(.desktop) {
    display: none;
  }
}

/* Extended Dark Mode Styles */
body.dark-mode .input-field,
body.dark-mode .input-select {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

body.dark-mode .navbar-links a:hover {
  background: #374151;
  color: var(--primary);
}

body.dark-mode .dropdown-content {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode .dropdown-content a {
  color: #f9fafb;
}

body.dark-mode .dropdown-content a:hover {
  background: #374151;
}

body.dark-mode .table-header .table-cell {
  background: #374151;
  color: #f9fafb;
}

body.dark-mode .category-table,
body.dark-mode .sheets-table {
  background: #1f2937;
}

body.dark-mode .table-cell,
body.dark-mode .table-cell-2 {
  border-color: #374151;
  color: #f9fafb;
}

/* Dark mode for Financial News */
body.dark-mode .news-card {
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.95), rgba(55, 65, 81, 0.98));
  border-color: #4b5563;
  color: #f9fafb;
}

body.dark-mode .news-title-text {
  color: #f9fafb;
}

body.dark-mode .news-meta {
  color: #9ca3af;
}

body.dark-mode .news-source {
  color: #a5b4fc;
}

body.dark-mode .news-category-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.25));
  color: #a5b4fc;
}

body.dark-mode .news-link {
  color: #a5b4fc;
}

body.dark-mode .news-card-link:hover .news-link {
  color: #c7d2fe;
}

/* Dark mode for AI Assistant */
body.dark-mode .ai-assistant-widget {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

body.dark-mode .ai-content {
  background: #1f2937;
}

body.dark-mode .ai-card {
  background: #374151;
  color: #f9fafb;
}

body.dark-mode .ai-card:hover {
  background: #4b5563;
}

body.dark-mode .ai-card-title {
  color: #f9fafb;
}

body.dark-mode .ai-card-message {
  color: #d1d5db;
}

body.dark-mode .ai-confidence {
  background: #4b5563;
  color: #d1d5db;
}

body.dark-mode .ai-empty {
  color: #9ca3af;
}

body.dark-mode .ai-loading {
  color: #d1d5db;
}

body.dark-mode .privacy-section {
  background: linear-gradient(135deg, #059669, #047857);
}

body.dark-mode .privacy-details h4 {
  color: #f9fafb;
}

body.dark-mode .privacy-details li {
  color: #d1d5db;
}

body.dark-mode .privacy-guarantee {
  background: #374151;
  border-left-color: #10b981;
}

body.dark-mode .privacy-guarantee p {
  color: #d1d5db;
}

/* Dark mode for cards and containers */
body.dark-mode .feature-card,
body.dark-mode .welcome-card,
body.dark-mode .auth-card {
  background: #1f2937;
  color: #f9fafb;
}

body.dark-mode .summary-card {
  background: #1f2937;
}

body.dark-mode .card-header {
  background: #374151;
  border-color: #4b5563;
}

body.dark-mode .card-header h3 {
  color: #f9fafb;
}

body.dark-mode .metric .label {
  color: #d1d5db;
}

body.dark-mode .metric .value {
  color: #f9fafb;
}

body.dark-mode .progress-container {
  background: #1f2937;
}

body.dark-mode .progress-info h4 {
  color: #f9fafb;
}

body.dark-mode .progress-info p {
  color: #d1d5db;
}

body.dark-mode .alert {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

body.dark-mode .alert-content h4 {
  color: #f9fafb;
}

body.dark-mode .alert-content p {
  color: #d1d5db;
}

/* Desktop header actions - keep horizontal layout */
@media (min-width: 1200px) {
  .mobile-header-row {
    display: contents;
  }
  
  .header-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .header-actions .btn {
    width: auto;
  }
}

/* Dark mode mobile table adjustments */
body.dark-mode .category-table tr {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode .category-table tr:hover {
  background: #374151;
}

body.dark-mode .category-row {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), #1f2937) !important;
  border-left-color: var(--primary) !important;
}

body.dark-mode .category-row:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), #374151) !important;
}

body.dark-mode .subcategory-row {
  background: #1f2937 !important;
  border-left-color: #4b5563 !important;
}

body.dark-mode .subcategory-add-row {
  background: #374151 !important;
  border-left-color: var(--success) !important;
}

body.dark-mode .category-add-row {
  background: linear-gradient(135deg, var(--success), #047857) !important;
}

body.dark-mode .category-table td:before {
  color: #9ca3af;
}

body.dark-mode .category-add-row td:before {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Dark mode sheets table adjustments */
@media (max-width: 1200px) {
  body.dark-mode .table-wrapper .category-table tr {
    background: #1f2937;
  }
  
  body.dark-mode .table-wrapper .category-table tr:hover {
    background: #374151;
  }
}

/* Exclude toasts from dark mode - keep original colors */
body.dark-mode .toast {
  background: unset;
  border-color: unset;
  color: unset;
}

body.dark-mode .toast.info {
  background: #dbeafe;
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

body.dark-mode .toast.success {
  background: #dcfce7;
  border-left: 4px solid var(--success);
  color: #166534;
}

body.dark-mode .toast.warning {
  background: #fef3c7;
  border-left: 4px solid var(--warning);
  color: #92400e;
}

body.dark-mode .toast.error {
  background: #fee2e2;
  border-left: 4px solid var(--danger);
  color: #991b1b;
}

/* Restore colorful borders for news cards */
body.dark-mode .news-card.banking {
  border-left: 4px solid #10b981;
}

body.dark-mode .news-card.markets {
  border-left: 4px solid #6366f1;
}

body.dark-mode .news-card.economy {
  border-left: 4px solid #f59e0b;
}

body.dark-mode .news-card.crypto {
  border-left: 4px solid #f97316;
}

body.dark-mode .news-card.general {
  border-left: 4px solid #8b5cf6;
}

/* Restore AI Assistant gradient */
body.dark-mode .ai-assistant-widget {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Keep colorful category badges */
body.dark-mode .news-category-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.4));
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

/* Restore colorful AI cards */
body.dark-mode .ai-card.warning {
  border-left-color: var(--warning);
  background: rgba(245, 158, 11, 0.15);
}

body.dark-mode .ai-card.danger {
  border-left-color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

body.dark-mode .ai-card.success {
  border-left-color: var(--success);
  background: rgba(34, 197, 94, 0.15);
}

/* Keep progress bar colorful */
body.dark-mode .progress-fill {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

/* Keep alert colors */
body.dark-mode .alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

body.dark-mode .alert-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

body.dark-mode .alert-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* Dark mode for responsive navigation */
body.dark-mode .navbar-links {
  background: #1f2937;
}

body.dark-mode #navbarAuthLinks {
  background: #1f2937;
}

body.dark-mode .user-info {
  background: transparent;
}

/* Dark mode fixes for user guide animations */
body.dark-mode .demo-sheet {
  background: #1f2937 !important;
  border: 1px solid #4b5563 !important;
}

body.dark-mode .demo-category {
  color: #f9fafb !important;
  border-bottom-color: #4b5563 !important;
}

body.dark-mode .demo-category span {
  color: #f9fafb !important;
}

body.dark-mode .demo-form input {
  background: #374151 !important;
  border-color: #4b5563 !important;
  color: #f9fafb !important;
}

body.dark-mode .demo-form input::placeholder {
  color: #9ca3af !important;
}

body.dark-mode .demo-save {
  background: var(--primary) !important;
  color: white !important;
}

body.dark-mode .ai-text {
  background: #1f2937 !important;
  color: #f9fafb !important;
  border: 1px solid #4b5563 !important;
}

body.dark-mode .budget-item {
  background: #1f2937 !important;
  color: #f9fafb !important;
}

body.dark-mode .budget-item span {
  color: #f9fafb !important;
}

body.dark-mode .result-item {
  background: #1f2937 !important;
  color: #f9fafb !important;
}

body.dark-mode .file-item {
  background: #1f2937 !important;
  color: #f9fafb !important;
}

body.dark-mode .file-name {
  color: #f9fafb !important;
}

body.dark-mode .demo-interface,
body.dark-mode .scanner-demo,
body.dark-mode .dashboard-demo {
  background: #374151 !important;
}

body.dark-mode .ai-demo-animation,
body.dark-mode .multiple-budgets-animation,
body.dark-mode .scanner-animation,
body.dark-mode .export-animation {
  background: #374151 !important;
  border-color: #4b5563 !important;
}

body.dark-mode .budget-add {
  background: #374151 !important;
  border-color: #4b5563 !important;
  color: #f9fafb !important;
}

body.dark-mode .budget-add span {
  color: #f9fafb !important;
}

/* Security Log Icons Colors */
.log-type-login-attempt .log-icon {
    background: #3b82f6 !important;
}

.log-type-password-changed .log-icon,
.log-type-password-change-request .log-icon {
    background: #f59e0b !important;
}

.log-type-email-changed .log-icon,
.log-type-email-change-request .log-icon {
    background: #8b5cf6 !important;
}

.log-type-2fa-enabled .log-icon,
.log-type-2fa-disabled .log-icon,
.log-type-backup-codes-regenerated .log-icon,
.log-type-2fa-login-success .log-icon {
    background: #10b981 !important;
}

.security-log-item.failed .log-icon {
    background: #ef4444 !important;
}

/* Billing toggle styles */
.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin: 1rem 0;
}

.toggle-label {
  font-weight: 500;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: 0.3s;
  border-radius: 30px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
  background-color: var(--primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(30px);
}

.discount-badge {
  background: var(--success);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  display: block;
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .billing-toggle {
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
    width: 100%;
    max-width: 500px;
    margin: 1rem auto;
  }
  
  .toggle-switch {
    width: 70px;
    height: 35px;
  }
  
  .toggle-slider:before {
    height: 28px;
    width: 28px;
    left: 3.5px;
    bottom: 3.5px;
  }
  
  input:checked + .toggle-slider:before {
    transform: translateX(35px);
  }
  
  .toggle-label {
    font-size: 1rem;
    white-space: nowrap;
  }
}
/* Plan Badge Basic - Same in both modes */
body.dark-mode .plan-badge.basic {
    background: linear-gradient(135deg, #6b7280, #4b5563) !important;
}

/* Dark mode billing toggle */
body.dark-mode .billing-toggle {
  background: #1f2937;
  border: 1px solid #374151;
}

body.dark-mode .toggle-label {
  color: #f9fafb;
}

body.dark-mode .toggle-slider {
  background-color: #4b5563;
}

body.dark-mode input:checked + .toggle-slider {
  background-color: var(--primary);
}

/* Categories Edit Button Fixes */
.action-button.edit-btn {
  background: var(--gray-400) !important;
  color: white !important;
  border: 1px solid var(--gray-400) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.action-button.edit-btn:hover {
  background: var(--gray-500) !important;
  border-color: var(--gray-500) !important;
}

/* Mobile category buttons - fix icons and colors */
@media (max-width: 1200px) {
  .category-mobile-btn.edit {
    background: var(--gray-300) !important;
    color: var(--gray-700) !important;
  }
  
  .category-mobile-btn.delete {
    background: #ef4444 !important;
    color: white !important;
  }
  
  .category-mobile-btn i {
    font-size: 14px !important;
    line-height: 1 !important;
    width: 14px !important;
    height: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .mobile-sub-btn i {
    font-size: 12px !important;
    line-height: 1 !important;
    width: 12px !important;
    height: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}
/* AGGRESSIVE CATEGORY EDIT BUTTON FIXES */
button.action-button.edit-btn,
.action-button.edit-btn,
.categories-page .action-button.edit-btn {
  background: var(--gray-300) !important;
  color: var(--gray-700) !important;
  border: 1px solid var(--gray-300) !important;
  box-shadow: 0 2px 4px rgba(209, 213, 219, 0.3) !important;
}

button.action-button.edit-btn:hover,
.action-button.edit-btn:hover {
  background: var(--gray-400) !important;
  border-color: var(--gray-400) !important;
  color: var(--gray-700) !important;
}

/* Mobile category edit buttons */
.category-mobile-btn.edit {
  background: var(--gray-300) !important;
  color: var(--gray-700) !important;
  border: none !important;
}

.category-mobile-btn.delete {
  background: #ef4444 !important;
  color: white !important;
  border: none !important;
}

/* Fix icon stretching completely */
.category-mobile-btn i,
.mobile-sub-btn i,
.action-button i {
  font-size: 14px !important;
  line-height: 14px !important;
  width: 14px !important;
  height: 14px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  text-align: center !important;
}
/* Color all edit buttons in subcategories */
.subcategory-row .action-button.edit-btn,
.mobile-subcategory-actions .mobile-sub-btn.edit {
  background: var(--gray-300) !important;
  color: var(--gray-700) !important;
  border: 1px solid var(--gray-300) !important;
}

.subcategory-row .action-button.edit-btn:hover,
.mobile-subcategory-actions .mobile-sub-btn.edit:hover {
  background: var(--gray-400) !important;
  border-color: var(--gray-400) !important;
}
/* FORCE HIDE EDIT BUTTONS DURING EDITING */
.d-none {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}
/* Round delete modal headers */
#deleteCategoryModal .modal-header,
#deleteSubcategoryModal .modal-header {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
/* Add spacing between edit input and buttons */
.table-cell .input-field {
  margin-right: 1rem !important;
  margin-bottom: 0.5rem !important;
}

.category-mobile-info .mobile-edit-input {
  margin-bottom: 1rem !important;
}
/* Plan cykliczny buttons - warning color */
.action-button[onclick*="addCyclicPlan"] {
  background: var(--warning) !important;
  color: white !important;
  border: 1px solid var(--warning) !important;
}

.action-button[onclick*="addCyclicPlan"]:hover {
  background: #d97706 !important;
  border-color: #d97706 !important;
}

/* Edit buttons - gray color */
.mobile-sub-btn.edit,
.action-button.edit-btn {
  background: var(--gray-300) !important;
  color: var(--gray-700) !important;
  border: 1px solid var(--gray-300) !important;
}

.mobile-sub-btn.edit:hover,
.action-button.edit-btn:hover {
  background: var(--gray-400) !important;
  border-color: var(--gray-400) !important;
}
/* Sheets mobile edit buttons - gray color */
.mobile-action-btn.edit {
  background: var(--gray-300) !important;
  color: var(--gray-700) !important;
  border: 1px solid var(--gray-300) !important;
}

.mobile-action-btn.edit:hover {
  background: var(--gray-400) !important;
  border-color: var(--gray-400) !important;
}

/* Ensure edit buttons are visible and clickable */
.mobile-action-btn {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Hide save/cancel buttons by default in sheets */
.mobile-action-btn.save.d-none,
.mobile-action-btn.cancel.d-none {
  display: none !important;
}

/* Mobile edit functionality for sheets */
.mobile-value-amount.editing {
  display: none !important;
}

.mobile-edit-input {
  display: none !important;
  width: 97% !important;
  padding: 0.5rem !important;
  border: 2px solid var(--primary) !important;
  border-radius: var(--radius) !important;
  font-size: 1rem !important;
  text-align: center !important;
  background: var(--white) !important;
  color: var(--gray-800) !important;
}

.mobile-edit-input.show {
  display: block !important;
}

/* Mobile action buttons state management */
.mobile-action-btn.d-none {
  display: none !important;
}

.mobile-action-btn.save {
  background: var(--success) !important;
  color: white !important;
}

.mobile-action-btn.cancel {
  background: var(--danger) !important;
  color: white !important;
}

.mobile-value-item {
  position: relative;
}
/* Mobile edit input for sheets */
.mobile-edit-input {
    display: none;
    background: var(--white) !important;
    border: 2px solid var(--primary) !important;
    border-radius: var(--radius) !important;
    padding: 0.5rem !important;
    text-align: center !important;
    font-size: 1rem !important;
    width: 97% !important;
    color: var(--gray-800) !important;
}

/* Smaller mobile action button icons */
.mobile-action-btn i {
    font-size: 12px !important;
    width: 12px !important;
    height: 12px !important;
}

.mobile-edit-input.show {
    display: block !important;
}

.mobile-edit-input.show.d-none {
    display: block !important;
}

.mobile-edit-input:focus {
    outline: none !important;
    border-color: var(--primary-dark) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}
/* Mobile fixes */
.mobile-header-row .btn {
  gap: 0.25rem !important;
}

.mobile-subcategory-name {
  font-size: 0.9rem !important;
}

/* Categories mobile edit input */
.category-mobile-info .input-field {
  display: none;
  width: 97% !important;
  margin-bottom: 0.5rem !important;
}

.category-mobile-info .input-field.show {
  display: block !important;
}

.mobile-subcategory-info .input-field {
  display: none;
  width: 97% !important;
  margin-bottom: 0.5rem !important;
}

.mobile-subcategory-info .input-field.show {
  display: block !important;
}
/* Mobile button alignment fixes */
.mobile-header-row .btn {
  gap: 0.4rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mobile-header-row .btn i {
  font-size: 0.9rem !important;
}

/* Prevent scroll events from triggering category toggles */
.category-row {
  touch-action: pan-y !important;
  user-select: none !important;
}

.mobile-category-header {
  touch-action: pan-y !important;
  user-select: none !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}

.category-toggle {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  user-select: none !important;
}

.mobile-category-toggle {
  pointer-events: auto !important;
  cursor: pointer !important;
  padding: 0.5rem !important;
  margin: -0.5rem !important;
  min-width: 30px !important;
  min-height: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 5 !important;
  position: relative !important;
  touch-action: manipulation !important;
  user-select: none !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
}

/* Mobile cards container z-index */
.mobile-cards-container {
  position: relative;
  z-index: 1;
}

.mobile-category-card {
  position: relative;
  z-index: 1;
}

.mobile-action-btn {
  font-size: 0.8rem !important;
}

/* Hide X buttons on mobile */
@media (max-width: 768px) {
  .close-button {
    display: none !important;
  }
}
/* Mobile category toggle fix */
@media (max-width: 480px) {
  .mobile-category-toggle {
    font-size: 16px !important;
    margin-right: 0.5rem !important;
    padding: 0 !important;
    position: static !important;
    z-index: 5 !important;
    pointer-events: all !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--primary) !important;
    flex-shrink: 0 !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    vertical-align: middle !important;
  }
  
  .mobile-category-toggle.rotated {
    transform: rotate(180deg) !important;
  }
  
  .mobile-category-header {
    pointer-events: all !important;
    touch-action: pan-y !important;
    user-select: none !important;
  }
  
  .mobile-category-name {
    padding-right: 0 !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
  }
}
/* Bulk modal footer styles */
.bulk-modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Bulk modal footer mobile layout */
@media (max-width: 480px) {
  .bulk-modal-footer {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }
  
  .bulk-modal-footer .btn span {
    display: none !important;
  }
  
  .bulk-modal-footer .btn {
    padding: 0.75rem !important;
    min-height: 50px !important;
  }
  
  .bulk-modal-footer .btn i {
    font-size: 1.2rem !important;
  }
}
/* Mobile category names - scrollable with fixed buttons */
@media (max-width: 1200px) {
  .category-mobile-header {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }
  
  .category-mobile-info {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  
  .category-mobile-name {
    white-space: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    width: 100% !important;
    padding-right: 0.5rem !important;
  }
  
  .category-mobile-name::-webkit-scrollbar {
    display: none !important;
  }
  
  .category-mobile-actions {
    flex-shrink: 0 !important;
    display: flex !important;
    gap: 0.25rem !important;
  }
  
  .mobile-subcategory-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
  }
  
  .mobile-subcategory-info {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  
  .mobile-subcategory-name {
    white-space: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    width: 100% !important;
    padding-right: 0.5rem !important;
  }
  
  .mobile-subcategory-name::-webkit-scrollbar {
    display: none !important;
  }
  
  .mobile-subcategory-actions {
    flex-shrink: 0 !important;
    display: flex !important;
    gap: 0.25rem !important;
  }
  
  /* Ensure buttons stay in place */
  .category-mobile-btn,
  .mobile-sub-btn {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 16px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  }
  
  .category-mobile-btn i,
  .mobile-sub-btn i {
    font-size: 16px !important;
    line-height: 1 !important;
  }
  
  .category-mobile-btn.system {
    width: auto !important;
    height: 44px !important;
    border-radius: 22px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    gap: 8px !important;
    background: #10b981 !important;
    color: white !important;
  }
  
  .category-mobile-btn.edit {
    background: var(--gray-300) !important;
    color: var(--gray-700) !important;
  }
  
  .category-mobile-btn.save {
    background: #10b981 !important;
    color: white !important;
  }
  
  .category-mobile-btn.cancel {
    background: #ef4444 !important;
    color: white !important;
  }
  
  .category-mobile-btn.delete {
    background: #ef4444 !important;
    color: white !important;
  }
}