.nav-link.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  color: #60a5fa;
  border-left: 2px solid #3b82f6;
}

.nav-group.collapsed > .nav-items {
  display: none;
}
.nav-group.collapsed .chev {
  transform: rotate(-90deg);
  display: inline-block;
}
.nav-group .chev {
  transition: transform 0.2s ease;
  font-size: 0.65rem;
}
.nav-group > div:first-child:hover {
  color: #94a3b8;
}
.nav-group .nav-items {
  animation: fadeSlide 0.2s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 1px solid #334155;
  border-radius: 12px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #475569;
  box-shadow: 0 15px 30px -20px rgba(0,0,0,0.6);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}
.tab:hover { color: #e2e8f0; background: rgba(59,130,246,0.08); }
.tab.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(99,102,241,0.15));
  color: #dbeafe;
  border: 1px solid rgba(59,130,246,0.35);
  box-shadow: 0 4px 16px -10px rgba(59,130,246,0.6);
}

@media (max-width: 640px) {
  .tab { padding: 0.5rem 0.7rem; font-size: 0.8rem; }
  .stat-card .text-2xl { font-size: 1.3rem; }
  .card { border-radius: 10px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}
.btn-primary:hover { background: #2563eb; }

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

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

.btn-secondary {
  background: #334155;
  color: #e2e8f0;
}
.btn-secondary:hover { background: #475569; }

.btn-ghost {
  background: transparent;
  color: #94a3b8;
  border-color: #334155;
}
.btn-ghost:hover { background: #1e293b; color: #e2e8f0; }

.input, .select, .textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #e2e8f0;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #334155;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: #1e293b;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #334155;
}

table.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.5);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-red   { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-blue  { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-purple{ background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-slate { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast {
  background: #1e293b;
  border: 1px solid #334155;
  border-left: 3px solid #3b82f6;
  color: #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: 0 10px 25px -10px rgba(0,0,0,0.5);
  animation: toastIn 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}

.toast.success { border-left-color: #10b981; }
.toast.error   { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid #334155;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.log-line {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}
.log-line:hover { background: rgba(59, 130, 246, 0.08); }

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #475569;
  border-radius: 22px;
  transition: 0.2s;
}
.slider::before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: #3b82f6; }
.switch input:checked + .slider::before { transform: translateX(18px); }

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: #64748b;
}
.empty-state svg { margin: 0 auto 1rem; opacity: 0.6; }
