.header {
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-light);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) 0;
  height: 64px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-decoration: none;
  color: inherit;
}

.logo-image {
  height: 46px;
  object-fit: contain;
  border-radius: 2px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
  margin: 0;
}

.nav {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text-primary);
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}

.dropdown-toggle:hover {
  color: var(--text-primary);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  z-index: 1001;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: var(--space-md) var(--space-lg);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 14px;
}

.dropdown-menu a:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-sm) 0;
}

.user-dropdown {
  margin-left: auto;
}

.user-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
  cursor: pointer;
  color: var(--text-primary);
  text-decoration: none;
  min-width: 280px;
}

.user-toggle:hover {
  background: var(--bg-tertiary);
}

.user-profile-section {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
}

.user-avatar {
  width: 30px;
  height: 40px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary-teal), var(--primary-teal-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  border: 2px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

.user-name-line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-email {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.pro-badge {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.upgrade-link {
  color: var(--primary-teal);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.upgrade-link:hover {
  color: var(--primary-teal-dark);
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.user-dropdown .dropdown-menu {
  right: 0;
  left: auto;
  min-width: 280px;
  padding: var(--space-lg);
}

.nav a.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 4px 16px 4px 4px;
  background: var(--primary-teal);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.nav a.admin-nav-link:hover {
  background: var(--primary-teal-dark, #3a7a8e);
  color: #fff;
}

.admin-nav-link .user-avatar {
  width: 30px;
  height: 40px;
  border-radius: 6px;
  border: none;
  box-shadow: none;
}

.user-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.menu-section {
  display: flex;
  flex-direction: column;
}

.menu-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
  padding: 0 var(--space-md);
}

.menu-section a {
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

.menu-section a:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateX(4px);
}

.menu-section a.active {
  background: var(--bg-tertiary);
  color: var(--primary-teal);
  font-weight: 600;
}

.menu-section a.active:hover {
  background: var(--bg-tertiary);
  color: var(--primary-teal);
  transform: none;
}

.logout-link {
  color: #ef4444 !important;
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-md) !important;
  margin-top: var(--space-sm);
}

.logout-link:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

.main {
  flex: 1;
  padding: var(--space-3xl) 0;
}

.messages {
  margin-bottom: var(--space-lg);
}

.message {
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
}

.message-success {
  background: #f0fff4;
  color: #2f855a;
  border-color: #9ae6b4;
}

.message-error {
  background: #fed7d7;
  color: #c53030;
  border-color: #fc8181;
}

.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-light);
  padding: var(--space-3xl) 0;
}

.footer-content {
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-contacts {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-contact-label {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-contacts a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-contacts a:hover {
  color: var(--text-primary);
}

.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-4xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  margin-right: var(--space-xl);
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.profile-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  margin-right: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
  border: 1px solid var(--border-light);
}

.profile-info h3 {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

.profile-info p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  font-size: 14px;
}

.profile-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-4xl);
}

.profile-table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.profile-table td:first-child {
  font-weight: 500;
  width: 30%;
  color: var(--text-primary);
}

.status-verified {
  color: #10b981;
}

.status-unverified {
  color: #f59e0b;
}

/* ========== MOBILE ADAPTATION ========== */

.mobile-close-btn {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--bg-tertiary);
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle span:nth-child(1) {
  margin-bottom: 5px;
}

.mobile-menu-toggle span:nth-child(3) {
  margin-top: 5px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-menu-overlay {
    display: block;
    pointer-events: none;
  }

  .mobile-menu-overlay.active {
    pointer-events: auto;
  }

  .header-content {
    padding: var(--space-sm) 0;
    height: auto;
    min-height: 56px;
  }

  .logo-image {
    height: 36px;
  }

  .logo-subtitle {
    font-size: 11px;
  }

  .user-dropdown {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 1001;
    transition: right 0.3s ease;
    margin-left: 0;
  }

  .user-dropdown.active {
    right: 0;
  }

  .user-dropdown .mobile-close-btn {
    display: flex;
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
    z-index: 10;
  }

  .user-dropdown .mobile-close-btn:hover {
    background: var(--bg-tertiary);
  }

  .user-dropdown .mobile-close-btn::before,
  .user-dropdown .mobile-close-btn::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
  }

  .user-dropdown .mobile-close-btn::before {
    transform: rotate(45deg);
  }

  .user-dropdown .mobile-close-btn::after {
    transform: rotate(-45deg);
  }

  .user-toggle {
    padding: var(--space-lg);
    padding-top: var(--space-3xl);
    border-bottom: 1px solid var(--border-light);
    min-width: auto;
  }

  .user-email {
    display: block;
    font-size: 12px;
  }

  .user-name {
    font-size: 14px;
  }

  .user-avatar,
  .user-avatar-placeholder {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .dropdown-arrow {
    display: none;
  }

  .user-dropdown .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: auto;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .footer-top {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
  }

  .footer-info {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-contacts {
    flex-wrap: wrap;
    justify-content: center;
  }

  .main {
    padding: var(--space-xl) 0;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-avatar,
  .profile-avatar-placeholder {
    margin-right: 0;
    margin-bottom: var(--space-lg);
  }

  .profile-table td {
    display: block;
    padding: var(--space-sm) var(--space-md);
  }

  .profile-table td:first-child {
    width: 100%;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 12px;
    color: var(--text-secondary);
  }

  .profile-table tr {
    display: block;
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-sm) 0;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: var(--space-xs) 0;
  }

  .logo-image {
    height: 32px;
  }

  .user-name {
    font-size: 13px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pro-badge {
    font-size: 9px;
    padding: 2px 6px;
  }

  .user-avatar,
  .user-avatar-placeholder {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .user-dropdown .dropdown-menu {
    right: var(--space-xs);
    left: var(--space-xs);
    padding: var(--space-md);
  }

  .menu-section a {
    padding: var(--space-md) var(--space-md);
  }

  .footer {
    padding: var(--space-xl) 0;
  }

  .footer-copy {
    font-size: 12px;
  }

  .footer-links a {
    font-size: 12px;
  }

  .footer-contact-label {
    font-size: 12px;
  }

  .footer-contacts a {
    font-size: 12px;
  }
}

/* ===== Error Pages (404, 403) ===== */

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    padding: 60px 24px;
    max-width: 480px;
    margin: 0 auto;
}

.error-code {
    font-size: 120px;
    font-weight: 800;
    color: var(--primary-teal);
    line-height: 1;
    letter-spacing: -6px;
    opacity: 0.12;
    user-select: none;
}

.error-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.error-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 36px;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

.error-btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.error-btn-primary:hover {
    opacity: 0.85;
}

.error-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.error-btn-secondary:hover {
    background: var(--border-light);
}

@media (max-width: 480px) {
    .error-code {
        font-size: 80px;
        letter-spacing: -3px;
    }

    .error-title {
        font-size: 18px;
    }

    .error-text {
        font-size: 14px;
    }

    .error-btn {
        padding: 11px 24px;
        font-size: 13px;
    }
}