body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 16rem;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  z-index: 50;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #475569;
  border-radius: 0.5rem;
}
.nav-link:hover {
  background: #f8fafc;
  color: #0f172a;
}
.nav-link.active {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.metric-card {
  position: relative;
  overflow: hidden;
}
.metric-label {
  color: #64748b;
  font-size: 0.9rem;
}
.metric-value {
  color: #0f172a;
  font-weight: 700;
}
.input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: #0284c7;
  transition: background 0.2s, transform 0.1s;
  border: none;
}
.btn:hover {
  background: #0369a1;
}
.btn:active {
  transform: translateY(1px);
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0369a1;
  border: 1px solid #bae6fd;
  background: #e0f2fe;
  transition: background 0.2s, transform 0.1s;
}
.btn-outline:hover {
  background: #dbeafe;
}
.btn-outline:active {
  transform: translateY(1px);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafc;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
}
.table td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
  color: #0f172a;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
.no-scroll {
  overflow: hidden;
}
.collapse-btn {
  position: fixed;
  left: 12px;
  bottom: 16px;
  z-index: 60;
  background: #0ea5e9;
  color: #fff;
  height: 36px;
  width: 36px;
  border-radius: 9999px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.35);
}
@media (min-width: 768px) {
  .collapse-btn { display: inline-flex; }
}
.sidebar-collapsed #sidebar {
  transform: translateX(-100%);
}
.sidebar-collapsed .main-content {
  padding-left: 0 !important;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .nav-link {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
}

/* Dark mode */
body.dark {
  background: #0b1220;
  color: #e2e8f0;
}
.dark .sidebar {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.dark #sidebar {
  background: #0f172a;
}
.dark .nav-link {
  color: #cbd5e1;
}
.dark .nav-link:hover {
  background: #1e293b;
  color: #fff;
}
.dark .nav-link.active {
  background: #0ea5e9;
  color: #fff;
}
.dark .card {
  background: #111827;
  border-color: #1f2937;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.dark .metric-card {
  background: linear-gradient(135deg, #0f172a, #111827);
  border-color: #1e293b;
}
.dark .metric-label {
  color: #cbd5e1 !important;
}
.dark .metric-value {
  color: #f8fafc !important;
}
.dark .input {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}
.dark .input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}
.dark .table th {
  background: #0f172a;
  color: #94a3b8;
  border-bottom-color: #1e293b;
}
.dark .table td {
  color: #e2e8f0;
  border-bottom-color: #1e293b;
}
.dark .btn {
  background: #0ea5e9;
  color: #0b1220;
}
.dark .btn:hover {
  background: #0284c7;
}
.dark .btn-outline {
  background: transparent;
  color: #0ea5e9;
  border-color: #0ea5e9;
}
.dark .btn-outline:hover {
  background: rgba(14, 165, 233, 0.1);
}
.dark .sidebar-backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.dark .text-slate-700,
.dark .text-slate-600,
.dark .text-slate-500 {
  color: #cbd5e1;
}
.dark .text-slate-800 {
  color: #e2e8f0;
}
.dark .text-slate-700 {
  color: #d6e1f2;
}
.dark .text-slate-600 {
  color: #cbd5e1;
}
.dark .text-slate-500 {
  color: #a8b8d8;
}
.dark .text-slate-400 {
  color: #94a3b8;
}
.dark .text-slate-400 {
  color: #94a3b8;
}
.dark .text-emerald-700 {
  color: #34d399;
}
.dark .text-sky-700,
.dark .text-blue-700 {
  color: #38bdf8;
}
.dark .border-slate-200 {
  border-color: #1e293b;
}
.dark .bg-white {
  background-color: #0f172a;
}
.dark .bg-slate-50 {
  background-color: #0b1220;
}
.dark .bg-slate-100 {
  background-color: #1e293b;
}
.dark .bg-slate-200 {
  background-color: #243447;
}
.dark .card h1,
.dark .card h2,
.dark .card h3,
.dark .card h4,
.dark .card .text-2xl,
.dark .card .text-lg,
.dark .card .text-base {
  color: #e2e8f0;
}
.dark .card .text-sm {
  color: #cbd5e1;
}
.dark .text-muted {
  color: #9ca3af;
}
.dark .table thead tr {
  background: #0f172a;
}
.dark .bg-sky-50,
.dark .bg-amber-50,
.dark .bg-emerald-50,
.dark .bg-indigo-50,
.dark .bg-red-50,
.dark .bg-green-50 {
  background-color: #0f172a;
}
.dark .border-sky-200,
.dark .border-amber-200,
.dark .border-emerald-200,
.dark .border-indigo-200,
.dark .border-red-200,
.dark .border-green-200 {
  border-color: #1e293b;
}

/* Atom animation (login) */
.atom {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}
.nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  background: radial-gradient(circle, #38bdf8 0%, #0ea5e9 60%, #0b1220 100%);
  border-radius: 9999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.7);
}
.orbit {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 50%;
  animation: spin 6s linear infinite;
}
.orbit span {
  position: absolute;
  top: 50%;
  left: -6px;
  width: 12px;
  height: 12px;
  background: #38bdf8;
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}
.orbit-1 { transform: rotateX(65deg); animation-duration: 6s; }
.orbit-2 { transform: rotateY(75deg); animation-duration: 7.5s; }
.orbit-3 { transform: rotateZ(15deg); animation-duration: 9s; }

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

/* Atom animation */
.ttd-atom {
  display: block;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 10px rgba(43, 208, 255, 0.25));
}
.ttd-atom .orbit {
  transform-origin: 50px 50px;
}
@keyframes ttd-spin { to { transform: rotate(360deg); } }
@keyframes ttd-spin-r { to { transform: rotate(-360deg); } }
@keyframes ttd-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.ttd-atom .orbit-a { animation: ttd-spin 9s linear infinite; }
.ttd-atom .orbit-b { animation: ttd-spin-r 12s linear infinite; }
.ttd-atom .orbit-c { animation: ttd-spin 15s linear infinite; }
.ttd-atom .core { animation: ttd-pulse 5s ease-in-out infinite; }
.ttd-atom .electron { filter: drop-shadow(0 0 6px rgba(43, 208, 255, 0.55)); }
@media (prefers-reduced-motion: reduce) {
  .ttd-atom .orbit-a,
  .ttd-atom .orbit-b,
  .ttd-atom .orbit-c,
  .ttd-atom .core {
    animation: none;
  }
}
