:root {
  --sidebar-width: 260px;
  --header-height: 64px;
  --transition-speed: 0.3s;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  color: #f1f5f9;
  overflow: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

.fade-enter-active, .fade-leave-active { transition: opacity var(--transition-speed); }
.fade-enter-from, .fade-leave-to { opacity: 0; }

.slide-enter-active, .slide-leave-active { transition: transform var(--transition-speed); }
.slide-enter-from { transform: translateX(-20px); opacity: 0; }
.slide-leave-to { transform: translateX(20px); opacity: 0; }

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  max-width: 320px;
}

.toast.success { background: #065f46; border: 1px solid #10b981; color: #34d399; }
.toast.error { background: #7f1d1d; border: 1px solid #ef4444; color: #fca5a5; }
.toast.info { background: #1e3a5f; border: 1px solid #3b82f6; color: #93c5fd; }
.toast.warning { background: #713f12; border: 1px solid #f59e0b; color: #fcd34d; }

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

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

.toast.leaving { animation: slideOutRight 0.3s ease forwards; }

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: #1e293b;
  border-right: 1px solid #334155;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-speed);
}

.sidebar.mobile-hidden { transform: translateX(-100%); }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  display: none;
}

.sidebar-overlay.active { display: block; }

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  color: #94a3b8;
  transition: all 0.2s;
  margin: 4px 12px;
  font-size: 14px;
  text-decoration: none;
}

.nav-item:hover, .nav-item.active {
  background: #334155;
  color: #f1f5f9;
}

.nav-item .icon { margin-right: 12px; font-size: 18px; width: 24px; text-align: center; }

/* Cards */
.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
}

.btn-primary { background: #6366f1; color: white; }
.btn-primary:hover { background: #4f46e5; }

.btn-secondary { background: #334155; color: #f1f5f9; border: 1px solid #475569; }
.btn-secondary:hover { background: #475569; }

.btn-success { background: #059669; color: white; }
.btn-success:hover { background: #047857; }

.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Forms */
.input {
  width: 100%;
  padding: 10px 14px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 14px;
  transition: border-color 0.2s;
}

.input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.input::placeholder { color: #64748b; }

/* Toggle Switch */
.toggle {
  width: 44px;
  height: 24px;
  background: #334155;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle.active { background: #10b981; }

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.toggle.active::after { transform: translateX(20px); }

/* Progress */
.progress-bar {
  height: 6px;
  background: #334155;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Table */
.table-container { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #334155;
}

th {
  font-weight: 600;
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover td { background: rgba(51,65,85,0.3); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #334155;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Mobile */
@media (max-width: 768px) {
  :root { --sidebar-width: 0; }
  .sidebar { width: 260px; }
  .main { margin-left: 0 !important; }
  .menu-toggle { display: flex !important; }
}

/* Status indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-online { background: #10b981; box-shadow: 0 0 8px #10b981; }
.status-busy { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.status-offline { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

/* Grid layouts */
.grid-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-industries { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* Login */
.login-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: rgba(30,41,59,0.9);
  backdrop-filter: blur(10px);
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* Chart containers */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}
