:root {
  --bg: #070a11;
  --surface: #0d121d;
  --surface-2: #111827;
  --surface-3: #151e2e;
  --border: rgba(148, 163, 184, .13);
  --border-strong: rgba(148, 163, 184, .22);
  --text: #e8eef8;
  --muted: #8b98ad;
  --muted-2: #64748b;
  --accent: #60a5fa;
  --accent-2: #818cf8;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(59,130,246,.10), transparent 28rem),
    radial-gradient(circle at 100% 20%, rgba(99,102,241,.08), transparent 30rem),
    linear-gradient(180deg, #080b12 0%, #070a11 50%, #090c14 100%);
  color: var(--text);
  min-height: 100vh;
}

::selection { background: rgba(96,165,250,.25); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #090d15; }
::-webkit-scrollbar-thumb { background: #263247; border-radius: 999px; border: 2px solid #090d15; }
::-webkit-scrollbar-thumb:hover { background: #34445f; }

.app-shell { position: relative; overflow-x: hidden; }
.ambient { position: fixed; width: 360px; height: 360px; border-radius: 999px; filter: blur(100px); opacity: .13; pointer-events: none; z-index: 0; }
.ambient-one { background: #2563eb; top: -190px; left: -100px; }
.ambient-two { background: #4f46e5; top: 35vh; right: -220px; }

.topbar {
  background: rgba(7,10,17,.76);
  border-bottom: 1px solid rgba(148,163,184,.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255,255,255,.02);
}
.brand { text-decoration: none; }
.brand-icon {
  width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 12px; color: #bfdbfe;
  background: linear-gradient(145deg, rgba(59,130,246,.23), rgba(99,102,241,.10));
  border: 1px solid rgba(96,165,250,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 24px rgba(37,99,235,.08);
}
.nav-desktop { height: 100%; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; height: 40px;
  padding: 0 12px; border-radius: 10px; color: #8b98ad;
  font-size: 13px; font-weight: 600; text-decoration: none; transition: .2s ease;
}
.nav-link i { width: 15px; text-align: center; font-size: 12px; }
.nav-link:hover { color: #e8eef8; background: rgba(148,163,184,.07); }
.nav-link.active { color: #dbeafe; background: rgba(59,130,246,.12); box-shadow: inset 0 0 0 1px rgba(96,165,250,.13); }
.nav-link.active i { color: #60a5fa; }
.nav-link.nav-logout:hover { color: #fecdd3; background: rgba(244,63,94,.08); }
.nav-divider { width: 1px; height: 20px; background: rgba(148,163,184,.14); margin: 0 3px; }
.mobile-menu-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border);
  color: #cbd5e1; background: rgba(15,23,42,.72); transition: .2s ease;
}
.mobile-menu-btn:hover { border-color: rgba(96,165,250,.3); color: #fff; }
.mobile-menu { border-top: 1px solid rgba(148,163,184,.09); }
.mobile-link {
  min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 13px;
  border-radius: 11px; text-decoration: none; color: #9aa7bb; background: rgba(15,23,42,.40);
  border: 1px solid rgba(148,163,184,.07); font-size: 13px; font-weight: 600;
}
.mobile-link i { width: 16px; color: #64748b; }
.mobile-link.active { color: #dbeafe; border-color: rgba(96,165,250,.18); background: rgba(59,130,246,.10); }
.mobile-link.active i { color: #60a5fa; }
.mobile-logout { color: #fda4af; background: rgba(244,63,94,.06); }

.app-footer { border-top: 1px solid rgba(148,163,184,.08); color: #5f6b7e; background: rgba(7,10,17,.50); }
.footer-status { display: inline-flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 999px; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.08); }

/* Dark conversion for existing Tailwind-based views */
.bg-white,
.bg-gray-50,
.bg-gray-100 { background-color: var(--surface) !important; }
.bg-blue-50 { background: linear-gradient(145deg, rgba(37,99,235,.14), rgba(15,23,42,.74)) !important; }
.bg-green-50 { background: linear-gradient(145deg, rgba(16,185,129,.12), rgba(15,23,42,.74)) !important; }
.bg-red-50 { background: linear-gradient(145deg, rgba(244,63,94,.11), rgba(15,23,42,.74)) !important; }
.bg-yellow-50 { background: linear-gradient(145deg, rgba(245,158,11,.10), rgba(15,23,42,.74)) !important; }

.text-gray-800, .text-gray-900 { color: #e6edf7 !important; }
.text-gray-700 { color: #c7d1df !important; }
.text-gray-600 { color: #98a6ba !important; }
.text-gray-500 { color: #718096 !important; }
.text-gray-400 { color: #64748b !important; }
.text-blue-600 { color: #60a5fa !important; }
.text-green-600 { color: #34d399 !important; }
.text-red-600, .text-red-500 { color: #fb7185 !important; }
.text-yellow-500 { color: #fbbf24 !important; }

.border, .border-gray-100, .border-gray-200, .border-gray-300,
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: var(--border) !important; }

.shadow-sm, .shadow-md, .shadow-lg { box-shadow: var(--shadow) !important; }

.bg-white.rounded-xl,
.bg-white.rounded-lg,
.bg-gray-50.rounded-lg {
  border: 1px solid var(--border) !important;
  box-shadow: 0 18px 55px rgba(0,0,0,.20) !important;
  transition: border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.bg-white.rounded-xl:hover { border-color: rgba(96,165,250,.20) !important; box-shadow: 0 22px 68px rgba(0,0,0,.25) !important; }

/* Inputs */
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  background: #0a0f19 !important;
  border-color: rgba(148,163,184,.16) !important;
  color: #e5edf8 !important;
  min-height: 44px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.015);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
textarea { min-height: initial; resize: vertical; }
input::placeholder, textarea::placeholder { color: #4f5d72 !important; opacity: 1; }
input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: rgba(96,165,250,.48) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.10) !important;
  background: #0c121e !important;
}
select option { background: #0d1420; color: #e5edf8; }
input[type="checkbox"], input[type="radio"] { accent-color: #3b82f6; }
code { background: rgba(148,163,184,.08) !important; color: #bfdbfe !important; border: 1px solid rgba(148,163,184,.08); }

/* Buttons */
button, a { -webkit-tap-highlight-color: transparent; }
button { transition: transform .18s ease, filter .18s ease, background .18s ease, border-color .18s ease; }
button:not(:disabled):active { transform: translateY(1px); }
.bg-blue-600 { background: linear-gradient(135deg, #2563eb, #4f46e5) !important; box-shadow: 0 8px 22px rgba(37,99,235,.15); }
.bg-blue-600:hover, .hover\:bg-blue-700:hover { filter: brightness(1.08); }
.bg-green-600 { background: linear-gradient(135deg, #059669, #0d9488) !important; }
.bg-red-600, .bg-red-500 { background: linear-gradient(135deg, #e11d48, #dc2626) !important; }
.bg-gray-600, .bg-gray-500 { background: #263247 !important; }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none !important; }

/* Tables */
.overflow-x-auto { scrollbar-width: thin; scrollbar-color: #263247 #090d15; }
table { color: #d7e0ec; border-collapse: separate; border-spacing: 0; }
thead.bg-gray-50, thead { background: rgba(15,23,42,.72) !important; }
thead th { color: #718096 !important; border-bottom: 1px solid var(--border) !important; font-weight: 700 !important; letter-spacing: .08em; }
tbody.bg-white { background: transparent !important; }
tbody tr { transition: background .18s ease; }
tbody tr:hover { background: rgba(96,165,250,.035); }
tbody td { border-bottom-color: rgba(148,163,184,.08) !important; }

/* Dynamic cards / logs */
.bg-gray-900 { background: #050810 !important; border: 1px solid rgba(148,163,184,.12); }
#logContainer { box-shadow: inset 0 0 35px rgba(0,0,0,.35); }
#statusList > div, #attackStatusContainer > div { border-color: var(--border) !important; }

/* Better visual hierarchy */
h1, h2, h3 { letter-spacing: -.025em; }
h1 i, h2 i, h3 i { filter: drop-shadow(0 0 12px rgba(96,165,250,.12)); }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(37,99,235,.15), transparent 35rem),
    radial-gradient(circle at 10% 100%, rgba(79,70,229,.10), transparent 32rem),
    #070a11;
}
.login-card {
  width: 100%; max-width: 430px; padding: 34px;
  border-radius: 20px; background: rgba(13,18,29,.84);
  border: 1px solid rgba(148,163,184,.13); backdrop-filter: blur(18px);
  box-shadow: 0 30px 90px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.025);
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 16px; display: grid; place-items: center;
  border-radius: 17px; color: #bfdbfe; font-size: 22px;
  background: linear-gradient(145deg, rgba(37,99,235,.22), rgba(79,70,229,.13));
  border: 1px solid rgba(96,165,250,.22);
}
.login-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: .25em; color: #5f6f86; font-weight: 700; }
.login-submit { min-height: 46px; border-radius: 11px; }

@media (max-width: 767px) {
  main { padding-top: 18px !important; padding-bottom: 24px !important; }
  .p-8 { padding: 20px !important; }
  .p-6 { padding: 18px !important; }
  .gap-6 { gap: 14px !important; }
  .mt-6 { margin-top: 14px !important; }
  h1.text-3xl { font-size: 1.55rem !important; }
  h2.text-2xl { font-size: 1.3rem !important; }
  h3.text-xl { font-size: 1.08rem !important; }

  /* Stack action headers and buttons cleanly */
  .bg-white.rounded-xl > .flex.justify-between.items-center,
  .bg-white.rounded-xl > .flex.justify-between.items-start {
    gap: 12px;
    flex-wrap: wrap;
  }

  form .md\:col-span-2.flex,
  form .md\:col-span-4.flex { flex-wrap: wrap; }
  form button { min-height: 42px; }

  /* Usable horizontal tables on phones */
  table { min-width: 720px; }
  th, td { padding-left: 14px !important; padding-right: 14px !important; }

  .login-card { padding: 26px 20px; border-radius: 17px; }
}

@media (max-width: 420px) {
  .mobile-link { font-size: 12px; min-height: 44px; }
  .brand-icon { width: 38px; height: 38px; }
}
