:root {
  --bg: #0b0d12;
  --bg-2: #11141c;
  --bg-3: #171b26;
  --line: #232936;
  --text: #e6e9f0;
  --muted: #8b93a7;
  --accent: #a855f7;
  --accent-2: #c084fc;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --blue: #60a5fa;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0,0,0,.45);
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}
.hidden { display: none !important; }

/* ---------- login ---------- */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(168,85,247,.18), transparent 60%), var(--bg);
}
.login-card {
  width: 360px; padding: 42px 36px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); text-align: center;
}
.login-logo { font-size: 46px; }
.login-card h1 { font-size: 26px; margin: 8px 0 2px; letter-spacing: .5px; }
.login-sub { color: var(--muted); margin-bottom: 26px; font-size: 13px; }
.login-card input {
  width: 100%; margin-bottom: 12px; padding: 12px 14px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); outline: none; font-size: 14px;
}
.login-card input:focus { border-color: var(--accent); }
.login-error { color: var(--red); margin-top: 10px; font-size: 13px; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex-shrink: 0; position: fixed; inset: 0 auto 0 0;
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 10;
}
.sidebar-brand {
  padding: 22px 20px; font-size: 17px; font-weight: 700; letter-spacing: .4px;
  border-bottom: 1px solid var(--line);
}
.sidebar nav { padding: 12px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; margin: 2px 0; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: rgba(168,85,247,.14); color: var(--accent-2); }
.nav-item .ico { width: 20px; text-align: center; }
.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px;
}
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.conn-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.conn-dot.off { background: var(--red); }
.sidebar-footer .btn { margin-left: auto; }

.main { margin-left: 230px; flex: 1; padding: 26px 32px; max-width: 1400px; }
.page { display: none; }
.page.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.page-header h2 { font-size: 21px; font-weight: 700; }
.edition-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px;
  background: rgba(168,85,247,.16); color: var(--accent-2); border: 1px solid rgba(168,85,247,.35);
}
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- stats ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.stat-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-num { font-size: 28px; font-weight: 800; font-family: var(--mono); }
.stat-label { color: var(--muted); margin-top: 4px; font-size: 12.5px; }
.stat-card.accent-green .stat-num { color: var(--green); }
.stat-card.accent-magenta .stat-num { color: var(--accent-2); }
.stat-card.accent-yellow .stat-num { color: var(--yellow); }
.stat-card.accent-red .stat-num { color: var(--red); }

/* ---------- panels / tables ---------- */
.panel {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; }
.table-wrap { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 11px 14px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg-2);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--bg-3); font-size: 13.5px; }
.table tr:hover td { background: var(--bg-3); }
.table .mono { font-family: var(--mono); font-size: 12.5px; }
.empty { padding: 34px; text-align: center; color: var(--muted); }

.toolbar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
}
.toolbar input[type="search"], .toolbar input[type="text"] {
  flex: 0 1 320px; padding: 9px 13px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); outline: none;
}
.toolbar input:focus { border-color: var(--accent); }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  padding: 9px 16px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 600; transition: filter .15s, background .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: var(--bg-3); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-danger { background: rgba(248,113,113,.14); color: var(--red); border: 1px solid rgba(248,113,113,.3); }
.btn-block { width: 100%; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
}
.badge.green { background: rgba(52,211,153,.14); color: var(--green); }
.badge.red { background: rgba(248,113,113,.14); color: var(--red); }
.badge.yellow { background: rgba(251,191,36,.14); color: var(--yellow); }
.badge.gray { background: var(--bg-3); color: var(--muted); }

/* ---------- phishlet cards ---------- */
.phishlet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.phishlet-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.phishlet-card .pl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.phishlet-card .pl-name { font-weight: 700; font-family: var(--mono); font-size: 14px; }
.phishlet-card .pl-host { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.phishlet-card .pl-actions { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- live feed ---------- */
.live-feed { max-height: 380px; overflow-y: auto; }
.feed-item {
  display: flex; gap: 12px; align-items: baseline;
  padding: 10px 18px; border-bottom: 1px solid var(--bg-3);
  font-size: 13px; animation: fadeIn .25s ease;
}
.feed-item .t { color: var(--muted); font-family: var(--mono); font-size: 11.5px; flex-shrink: 0; }
.feed-item.e-credentials_captured .msg { color: var(--green); }
.feed-item.e-tokens_captured .msg { color: var(--accent-2); font-weight: 600; }
.feed-item.e-bot_blocked .msg { color: var(--red); }
.feed-empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- blacklist ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 18px; }
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 99px;
  padding: 5px 12px; font-family: var(--mono); font-size: 12.5px;
}
.tag button { background: none; border: none; color: var(--red); cursor: pointer; font-size: 13px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.settings-grid .panel { padding-bottom: 18px; }
.settings-grid label { display: block; margin: 14px 18px 0; color: var(--muted); font-size: 12.5px; }
.settings-grid input {
  display: block; width: calc(100% ); margin-top: 6px; padding: 10px 13px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); outline: none;
}
.settings-grid input:focus { border-color: var(--accent); }
.settings-grid .btn { margin: 16px 18px 0; }
.kv { padding: 8px 18px 0; }
.kv .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--bg-3); }
.kv .k { color: var(--muted); }
.kv .v { font-family: var(--mono); font-size: 12.5px; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-box {
  width: min(760px, 94vw); max-height: 86vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg-2);
}
.modal-body { padding: 18px 20px; }
.modal-body pre {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; overflow-x: auto; font-family: var(--mono); font-size: 12px;
  margin: 10px 0; white-space: pre-wrap; word-break: break-all;
}
.kv-grid { display: grid; grid-template-columns: 140px 1fr; gap: 7px 14px; margin-bottom: 12px; }
.kv-grid .k { color: var(--muted); }
.kv-grid .v { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--bg-3); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 16px; min-width: 260px; max-width: 360px;
  box-shadow: var(--shadow); font-size: 13px; animation: slideIn .2s ease;
}
.toast.green { border-left-color: var(--green); }
.toast.red { border-left-color: var(--red); }
.toast.yellow { border-left-color: var(--yellow); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar-brand span, .nav-item span:not(.ico), .sidebar-footer span { display: none; }
  .nav-item { justify-content: center; }
  .main { margin-left: 64px; padding: 18px; }
}

/* ---------- team / org tree ---------- */
.team-tree { display: flex; flex-direction: column; gap: 14px; }
.org-group {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.org-node {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px; margin: 4px 0;
  background: var(--bg-3); font-weight: 600; font-size: 13.5px;
}
.org-node.master-node { border: 1px solid rgba(251,191,36,.4); color: var(--yellow); }
.org-node.admin-node { border: 1px solid rgba(52,211,153,.4); color: var(--green); }
.org-node.user-node { border: 1px solid var(--line); color: var(--text); }
.org-node.indented { margin-left: 34px; font-weight: 500; }
.role-badge { margin-left: auto; }

/* ---------- lure create bar (mobile-visible) ---------- */
.lure-create-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
}
.lure-create-bar label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.lure-create-bar select {
  flex: 1 1 200px; min-height: 40px; padding: 8px 12px;
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; outline: none;
}
.lure-create-bar select:focus { border-color: var(--accent); }
.lure-hint { color: var(--muted); font-size: 12.5px; margin: 0 2px 14px; }
.lure-hint b { color: var(--gold-2); }
