/* ЦИФРОВОЙ ОФИС — Premium Design System v3.0 */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --bg-deep: #070b15;
  --bg-primary: #080c18;
  --bg-secondary: #0d1225;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --text-primary: #f1f3f5;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-color: rgba(255,255,255,0.06);
  --border-accent: rgba(99,102,241,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(99,102,241,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-width: 260px;
  --navbar-height: 64px;
}
* { box-sizing: border-box; }
body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(6,182,212,0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(245,158,11,0.03) 0%, transparent 50%);
  z-index: -1;
  animation: bgShift 20s ease-in-out infinite;
}
@keyframes bgShift {
  0%, 100% { transform: translate(0,0); }
  33% { transform: translate(2%,1%); }
  66% { transform: translate(-1%,-2%); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(99,102,241,0.2); }
  50% { box-shadow: 0 0 20px rgba(99,102,241,0.4); }
}
.animate-fade-in { animation: fadeIn 0.5s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease-out; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-width); height: 100vh;
  background: rgba(8,12,24,0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  z-index: 1000;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.sidebar-logo .logo-text { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.sidebar-logo .logo-sub { font-size: 0.65rem; color: var(--text-muted); }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-section { padding: 0 12px; margin-top: 8px; }
.sidebar-section-title {
  padding: 8px 12px 4px;
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600;
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s ease; position: relative;
}
.sidebar-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.sidebar-item.active {
  background: rgba(99,102,241,0.12);
  color: var(--primary-light);
}
.sidebar-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 24px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.sidebar-item .item-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}
.sidebar-item.active .item-icon { background: rgba(99,102,241,0.2); color: var(--primary-light); }
.sidebar-item .item-badge {
  margin-left: auto; font-size: 0.65rem;
  padding: 2px 8px; border-radius: 10px;
  background: rgba(99,102,241,0.15); color: var(--primary-light);
}
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border-color); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.sidebar-user:hover { background: var(--bg-card-hover); }
.sidebar-user .avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.875rem; flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 0.8125rem; font-weight: 600; }
.sidebar-user .user-role { font-size: 0.7rem; color: var(--text-muted); }

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* Top Bar */
.topbar {
  height: var(--navbar-height);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(8,12,24,0.6);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-size: 1.125rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* Content Area */
.content-area { padding: 24px 32px 32px; }

/* Card Premium */
.card-premium {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}
.card-premium:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease-out;
}
.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-bottom: 2px; }
.stat-card .stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .stat-trend { font-size: 0.7rem; padding: 2px 8px; border-radius: 6px; }
.stat-card .stat-trend.up { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-card .stat-trend.down { background: rgba(239,68,68,0.15); color: var(--danger); }

/* Agents Grid */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.agent-card { padding: 16px; transition: all 0.3s ease; }
.agent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.agent-avatar { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.agent-gradient-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.agent-gradient-2 { background: linear-gradient(135deg, #10b981, #34d399); }
.agent-gradient-3 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.agent-gradient-4 { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.agent-gradient-5 { background: linear-gradient(135deg, #ef4444, #f87171); }
.agent-gradient-6 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.agent-gradient-7 { background: linear-gradient(135deg, #14b8a6, #5eead4); }
.agent-gradient-8 { background: linear-gradient(135deg, #e11d48, #fb7185); }
.agent-gradient-9 { background: linear-gradient(135deg, #0ea5e9, #7dd3fc); }
.agent-gradient-10 { background: linear-gradient(135deg, #84cc16, #a3e635); }

/* Buttons */
.btn-premium { padding: 8px 20px; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.875rem; transition: all 0.2s ease; border: none; }
.btn-premium-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-premium-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(99,102,241,0.3); }
.btn-premium-ghost { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-premium-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-accent); }

/* Forms */
.form-premium { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text-primary); font-size: 0.875rem; transition: all 0.2s; }
.form-premium:focus { background: var(--bg-secondary); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); color: var(--text-primary); }
.form-premium::placeholder { color: var(--text-muted); }

/* Badges */
.badge-premium { padding: 4px 12px; border-radius: 6px; font-weight: 500; font-size: 0.75rem; }
.badge-status-active { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-status-pending { background: rgba(245,158,11,0.15); color: var(--warning); }

/* Timeline */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -32px; top: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; background: var(--bg-secondary);
  border: 2px solid var(--border-color);
}
.timeline-dot.primary { border-color: var(--primary); background: rgba(99,102,241,0.15); color: var(--primary-light); }
.timeline-dot.success { border-color: var(--success); background: rgba(16,185,129,0.15); color: var(--success); }
.timeline-dot.warning { border-color: var(--warning); background: rgba(245,158,11,0.15); color: var(--warning); }
.timeline-content .timeline-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 2px; }
.timeline-content .timeline-text { font-size: 0.8rem; color: var(--text-secondary); }
.timeline-content .timeline-time { font-size: 0.7rem; color: var(--text-muted); }

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; border-radius: var(--radius-sm); }

/* Login Page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; }
.login-page::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 50%, rgba(6,182,212,0.06) 0%, transparent 50%);
}
.login-card {
  width: 100%; max-width: 420px;
  background: rgba(13,18,37,0.9);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  position: relative;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInUp 0.6s ease-out;
}

/* Premium Table */
.table-premium { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-premium th { padding: 12px 16px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border-color); }
.table-premium td { padding: 12px 16px; font-size: 0.875rem; border-bottom: 1px solid var(--border-color); }
.table-premium tr:hover td { background: var(--bg-card-hover); }

@media (max-width: 768px) {
  .sidebar { width: 72px; }
  .sidebar .logo-text, .sidebar .logo-sub, .sidebar .sidebar-section-title,
  .sidebar .item-label, .sidebar .item-badge, .sidebar .user-info { display: none; }
  .sidebar .sidebar-item { justify-content: center; padding: 10px; }
  .sidebar .sidebar-logo { justify-content: center; padding: 16px; }
  .main-content { margin-left: 72px; }
  .content-area { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .agents-grid { grid-template-columns: 1fr; }
}
