/* ===== DASHBOARD LAYOUT ===== */
.dashboard {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
  position: relative;
  overflow-x: hidden;
}

.dashboard::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(
      circle at 20% 20%,
      rgba(185, 103, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(0, 255, 255, 0.05) 0%,
      transparent 50%
    );
  z-index: -1;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 25px 20px;
  border-bottom: 1px solid var(--glass-border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}

.avatar {
  position: relative;
  width: 50px;
  height: 50px;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--dark);
}

.status.online {
  background: var(--accent);
}

.status.offline {
  background: #ff4757;
}

.user-info h3 {
  font-size: 1rem;
  margin-bottom: 5px;
  color: var(--light);
}

.user-email {
  font-size: 0.8rem;
  opacity: 0.7;
}

.sidebar-toggle {
  display: none;
  position: absolute;
  top: 25px;
  right: -40px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--light);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background: rgba(185, 103, 255, 0.2);
}

/* Навигация */
.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 25px;
  color: var(--light);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(185, 103, 255, 0.1);
}

.nav-item.active {
  background: linear-gradient(90deg, 
    rgba(185, 103, 255, 0.2), 
    transparent);
  border-left: 3px solid var(--primary);
}

.nav-item i {
  width: 20px;
  color: var(--secondary);
  font-size: 1.1rem;
}

.nav-item span {
  flex: 1;
  font-size: 0.95rem;
}

.badge {
  background: var(--primary);
  color: var(--light);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--glass-border);
}

.plan-info {
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
}

.plan-badge {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.plan-badge.pro {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--darker);
}

.plan-badge.free {
  background: var(--glass);
  color: var(--light);
}

.plan-info p {
  font-size: 0.85rem;
  margin-bottom: 10px;
  opacity: 0.9;
}

.upgrade-btn {
  display: block;
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--dark);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.upgrade-btn:hover {
  transform: translateY(-2px);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.2);
  color: #ff4757;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.logout-btn:hover {
  background: rgba(255, 71, 87, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  padding: 25px 40px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left h1 {
  font-size: 1.8rem;
  margin-bottom: 5px;
  color: var(--light);
}

.breadcrumb {
  font-size: 0.9rem;
  opacity: 0.7;
}

.breadcrumb a {
  color: var(--secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notification-btn {
  position: relative;
  background: none;
  border: 1px solid var(--glass-border);
  width: 45px;
  height: 45px;
  border-radius: 10px;
  color: var(--light);
  cursor: pointer;
  transition: all 0.3s ease;
}

.notification-btn:hover {
  background: rgba(185, 103, 255, 0.1);
  border-color: var(--primary);
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--primary);
  color: var(--light);
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-actions {
  display: flex;
  gap: 10px;
}

.quick-btn {
  white-space: nowrap;
}

/* Dashboard Content */
.dashboard-content {
  flex: 1;
  padding: 30px 40px;
  overflow-y: auto;
}

/* Stats Overview */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--dark);
}

.stat-info {
  flex: 1;
}

.stat-info h3 {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--light);
  margin-bottom: 3px;
}

.stat-desc {
  font-size: 0.85rem;
  opacity: 0.7;
}

.stat-action .action-btn {
  background: rgba(185, 103, 255, 0.1);
  border: 1px solid rgba(185, 103, 255, 0.3);
  color: var(--light);
  padding: 6px 15px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.stat-action .action-btn:hover {
  background: rgba(185, 103, 255, 0.2);
}

/* Services Section */
.services-section {
  margin-bottom: 40px;
}

.services-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--light);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.service-card {
  padding: 25px;
  transition: all 0.3s ease;
}

.service-card:hover {
  border-color: var(--secondary);
}

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

.service-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.service-status {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 15px;
  font-weight: 600;
}

.service-status.active {
  background: rgba(0, 255, 157, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 157, 0.2);
}

.service-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--light);
}

.service-card p {
  opacity: 0.8;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.service-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.metric i {
  color: var(--secondary);
  font-size: 1rem;
}

.metric span {
  font-size: 0.85rem;
  opacity: 0.8;
  text-align: center;
}

.service-actions {
  display: flex;
  gap: 10px;
}

.service-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
}

.service-btn:hover {
  background: rgba(185, 103, 255, 0.1);
}

.service-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--dark);
  border: none;
  font-weight: 600;
}

.service-btn.primary:hover {
  transform: translateY(-2px);
}

.add-new {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--glass-border);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-new:hover {
  border-color: var(--secondary);
  background: rgba(0, 255, 255, 0.02);
}

.add-service {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.add-service i {
  font-size: 2.5rem;
  color: var(--secondary);
  opacity: 0.7;
}

.add-service h3 {
  color: var(--light);
  margin: 0;
}

.add-service p {
  opacity: 0.7;
  margin: 0;
  font-size: 0.9rem;
}

/* Activity Section */
.activity-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.activity-card {
  padding: 25px;
}

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

.activity-header h3 {
  font-size: 1.3rem;
  color: var(--light);
}

.view-all {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

.view-all:hover {
  text-decoration: underline;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.activity-item {
  display: flex;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.activity-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.activity-icon.success {
  background: rgba(0, 255, 157, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 157, 0.2);
}

.activity-icon.warning {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.2);
}

.activity-icon.info {
  background: rgba(0, 195, 255, 0.1);
  color: #00c3ff;
  border: 1px solid rgba(0, 195, 255, 0.2);
}

.activity-content {
  flex: 1;
}

.activity-content p {
  margin-bottom: 5px;
  font-size: 0.95rem;
}

.activity-time {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Quick Stats */
.quick-stats-card {
  padding: 25px;
}

.quick-stats-card h3 {
  font-size: 1.3rem;
  margin-bottom: 25px;
  color: var(--light);
}

.quick-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
}

.quick-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.stat-circle {
  position: relative;
  width: 60px;
  height: 60px;
}

.stat-circle svg {
  transform: rotate(-90deg);
}

.stat-circle circle.bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
}

.stat-circle circle.progress {
  fill: none;
  stroke: var(--secondary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 157;
  stroke-dashoffset: calc(157 - (157 * var(--value)) / 100);
  animation: progressAnimation 1.5s ease-out;
}

@keyframes progressAnimation {
  from {
    stroke-dashoffset: 157;
  }
}

.stat-circle span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--light);
}

.quick-stat p {
  font-size: 0.85rem;
  opacity: 0.8;
  text-align: center;
}

/* API Info */
.api-info {
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.api-info h4 {
  font-size: 1rem;
  margin-bottom: 15px;
  color: var(--light);
}

.api-key {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  margin-bottom: 10px;
}

.api-key code {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--light);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.copy-btn:hover {
  color: var(--light);
}

.api-link {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

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

/* Footer */
.dashboard-footer {
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

.footer-info {
  display: flex;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--light);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--secondary);
}

/* Notifications Panel */
.notifications-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100vh;
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.notifications-panel.active {
  right: 0;
}

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

.panel-header h3 {
  font-size: 1.3rem;
  color: var(--light);
}

.close-panel {
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.close-panel:hover {
  opacity: 1;
}

.notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Мобильная адаптация */
@media (max-width: 1024px) {
  .activity-section {
    grid-template-columns: 1fr;
  }
  
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .sidebar-toggle {
    display: flex;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .dashboard-header {
    padding: 20px;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .dashboard-content {
    padding: 20px;
  }
  
  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .quick-actions {
    flex-wrap: wrap;
  }
  
  .notifications-panel {
    width: 100%;
    right: -100%;
  }
  
  .footer-info {
    flex-direction: column;
    gap: 10px;
  }
  
  .footer-links {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .stats-overview {
    grid-template-columns: 1fr;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .service-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .quick-stats {
    flex-direction: column;
    gap: 20px;
  }
}