/* ─── palette ───────────────────────────────────────────────────
   deep navy instead of pure black, teal as the only bright accent,
   amber for warnings. everything else is a tint of the surface.  */
:root {
  --bg:        #0b0f17;
  --surface:   #121826;
  --surface2:  #1a2233;
  --surface3:  #212b3f;
  --border:    #253045;
  --border-hi: #33415c;

  --accent:    #14b8a6;   /* teal, actions */
  --accent-dim:#0e8f81;
  --accent2:   #38bdf8;   /* sky, links and values */
  --accent-soft: rgba(20,184,166,0.12);

  --danger:    #f2545b;
  --warn:      #f0a94c;
  --ok:        #34d399;

  --text:      #dbe4f0;
  --text-dim:  #94a3b8;
  --muted:     #64748b;

  --font: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(20,184,166,0.10), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(56,189,248,0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.header {
  background: linear-gradient(120deg, rgba(26,34,51,0.95) 0%, rgba(18,24,38,0.95) 100%);
  border-bottom: 1px solid var(--border);
  padding: 12px 22px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.header .logo { font-size: 20px; line-height: 1; filter: saturate(0.9); }
.header h1 {
  font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text); font-weight: 700;
}
.header h1::after { content: ''; display: block; height: 2px; width: 34px; margin-top: 5px;
  background: linear-gradient(90deg, var(--accent), transparent); border-radius: 2px; }
.header > span:last-child { color: var(--muted); font-size: 11px; margin-left: auto; letter-spacing: 0.4px; }

/* ── LAYOUT ── */
.layout { display: flex; height: calc(100vh - 60px); }

.sidebar {
  width: 200px; min-width: 200px;
  background: linear-gradient(180deg, rgba(18,24,38,0.85), rgba(11,15,23,0.85));
  border-right: 1px solid var(--border);
  padding: 12px 0; overflow-y: auto;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; cursor: pointer;
  color: var(--text-dim); font-size: 12px;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  user-select: none;
}
.sidebar-item:hover { background: var(--surface2); color: var(--text); }
.sidebar-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  font-weight: 600;
}
.sidebar-item .icon { font-size: 14px; width: 18px; text-align: center; opacity: .9; }
.sidebar-sep { height: 1px; background: var(--border); margin: 8px 14px; }
.sidebar-label {
  font-size: 10px; color: var(--muted); padding: 10px 16px 4px;
  letter-spacing: 1.4px; text-transform: uppercase;
}

.main { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.tab-content {
  display: none; flex: 1; overflow: auto; padding: 20px;
  flex-direction: column; gap: 16px;
}
.tab-content.active { display: flex; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.22);
}
.card-flex { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.card-header {
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
}
.card-header .title { color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px; }
.card-body.no-pad { padding: 0; }
.card-body.full-height { height: 100%; }
.card-body.scroll { overflow: auto; }

.status {
  color: var(--muted); font-size: 11px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(100,116,139,0.12);
  border: 1px solid transparent;
  white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis;
}

/* ── DROP ZONE ── */
.drop-zone {
  display: block;
  border: 1.5px dashed var(--border-hi);
  border-radius: var(--radius);
  padding: 34px 22px;
  text-align: center; cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
  background: rgba(26,34,51,0.35);
}
.drop-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone.drag {
  border-color: var(--accent); background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.drop-zone .dz-icon { font-size: 30px; margin-bottom: 10px; opacity: .95; }
.drop-zone p { color: var(--text-dim); font-size: 12px; line-height: 1.7; }
.drop-zone p strong { color: var(--accent2); }
input[type=file] { display: none; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; font-family: var(--font); font-size: 12px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn .ico { font-size: 10px; opacity: .9; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #04211d; }
.btn-primary:hover:not(:disabled) { background: #1fd3bf; }
.btn-secondary {
  background: var(--surface2); color: var(--text);
  border-color: var(--border-hi);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: rgba(242,84,91,0.12); color: var(--danger); border-color: rgba(242,84,91,0.32); }
.btn-danger:hover:not(:disabled) { background: rgba(242,84,91,0.2); }
.btn-ok { background: rgba(52,211,153,0.12); color: var(--ok); border-color: rgba(52,211,153,0.32); }
.btn-ok:hover:not(:disabled) { background: rgba(52,211,153,0.2); }
.btn:disabled { opacity: .42; cursor: not-allowed; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gap-top { margin-top: 12px; }
.hidden { display: none; }
.field-label { color: var(--text-dim); font-size: 11px; }
.w-xs { width: 64px; }
.w-md { width: 168px; }
.count { color: var(--muted); font-size: 11px; margin-left: auto; }

/* ── CODE VIEW ── */
.code-view {
  background: #080c14;
  border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
  font-family: var(--font); font-size: 12px; line-height: 1.65;
  overflow: auto; max-height: 440px;
  white-space: pre; color: #a9b8d4; tab-size: 2;
}
.code-view.fill { max-height: none; height: 100%; min-height: 300px; }
.code-view .kw  { color: #c792ea; }
.code-view .str { color: #a3e28a; }
.code-view .cmt { color: #52607a; font-style: italic; }
.code-view .num { color: #ffb86c; }
.code-view .cls { color: #6fd3f2; }
.code-view .ann { color: #f0c274; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
}
.badge-danger { background: rgba(242,84,91,0.16);  color: var(--danger); }
.badge-warn   { background: rgba(240,169,76,0.16); color: var(--warn); }
.badge-ok     { background: rgba(52,211,153,0.16); color: var(--ok); }
.badge-muted  { background: rgba(100,116,139,0.16); color: var(--text-dim); }
.badge-accent { background: rgba(56,189,248,0.16); color: var(--accent2); }

/* ── PROGRESS ── */
.progress-wrap { background: var(--surface3); border-radius: 999px; height: 6px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 999px; transition: width .3s; }
.progress-bar.danger { background: var(--danger); }
.progress-bar.warn   { background: var(--warn); }
.progress-bar.ok     { background: var(--ok); }
.progress-bar.accent { background: var(--accent2); }

/* ── TABLE ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left; padding: 9px 12px;
  background: var(--surface2); color: var(--muted);
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1;
}
.tbl td { padding: 8px 12px; border-bottom: 1px solid rgba(37,48,69,0.6); vertical-align: middle; }
.tbl tbody tr:nth-child(even) td { background: rgba(255,255,255,0.014); }
.tbl tr:hover td { background: var(--surface2); }
.tbl .mono { font-family: var(--font); font-size: 11px; color: var(--accent2); }

/* ── FINDINGS ── */
.finding {
  display: flex; gap: 12px; padding: 11px 14px;
  border-radius: 8px; border: 1px solid var(--border);
  border-left: 3px solid var(--border-hi);
  background: var(--surface2); margin-bottom: 8px;
}
.finding .sev { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.finding .content { flex: 1; min-width: 0; }
.finding .label { font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.finding .detail { font-size: 11px; color: var(--text-dim); line-height: 1.55; }
.finding .snippet {
  margin-top: 6px; background: #080c14;
  border-radius: 6px; padding: 6px 10px;
  font-size: 11px; color: #f08a90; white-space: pre-wrap; word-break: break-all;
}

/* ── FILE TREE ── */
.tree-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; cursor: pointer; border-radius: 6px;
  font-size: 12px; color: var(--text-dim); transition: background .1s, color .1s;
}
.tree-item:hover { background: var(--surface2); color: var(--text); }
.tree-item.selected { background: var(--accent-soft); color: var(--accent); }
.tree-item .file-icon { font-size: 13px; opacity: .9; }

/* ── SPLIT PANE ── */
.split { display: flex; gap: 0; height: 100%; }
.split-left {
  width: 230px; min-width: 230px;
  border-right: 1px solid var(--border);
  overflow-y: auto; padding: 8px;
  background: rgba(11,15,23,0.4);
}
.split-right { flex: 1; overflow: auto; padding: 16px; min-width: 0; }

/* ── STAT GRID ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 10px; }
.stat-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat-box .val { font-size: 23px; font-weight: 700; line-height: 1; letter-spacing: -0.5px; }
.stat-box .lbl { font-size: 10px; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 1px; }
.stat-box.danger { border-color: rgba(242,84,91,0.3); }
.stat-box.danger .val { color: var(--danger); }
.stat-box.warn   { border-color: rgba(240,169,76,0.3); }
.stat-box.warn   .val { color: var(--warn); }
.stat-box.ok     { border-color: rgba(52,211,153,0.3); }
.stat-box.ok     .val { color: var(--ok); }
.stat-box.accent { border-color: rgba(56,189,248,0.3); }
.stat-box.accent .val { color: var(--accent2); }

/* ── LOG ── */
.log {
  background: #080c14; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px;
  font-size: 11px; line-height: 1.75; overflow-y: auto; max-height: 220px;
}
.log:empty::before { content: 'sin actividad'; color: var(--muted); opacity: .6; }
.log .log-info  { color: var(--accent2); }
.log .log-warn  { color: var(--warn); }
.log .log-error { color: var(--danger); }
.log .log-ok    { color: var(--ok); }
.log .log-muted { color: var(--muted); }

/* ── Aviso / advertencia ────────────────────────────────────── */
.warn-box {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 14px; padding: 12px 14px;
  background: rgba(240,169,76,0.08);
  border: 1px solid rgba(240,169,76,0.35);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  flex-shrink: 0;
}
.warn-box .warn-icon { font-size: 18px; line-height: 1.2; flex-shrink: 0; }
.warn-box .warn-img {
  width: 84px; height: 84px; flex-shrink: 0;
  object-fit: cover; border-radius: 6px;
  border: 1px solid rgba(240,169,76,0.35);
}
.warn-box .warn-text { font-size: 12px; line-height: 1.6; color: var(--text-dim); align-self: center; }
.warn-box .warn-text strong { color: var(--warn); }
.warn-box code { background: var(--surface3); padding: 1px 5px; border-radius: 4px; color: var(--accent2); font-size: 10.5px; }

/* ── Obfuscator ─────────────────────────────────────────────── */
.toggle-field { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 11px; cursor: pointer; user-select: none; }
.toggle-field input { accent-color: var(--accent); margin: 0; }
.drop-zone code { background: var(--surface3); padding: 1px 5px; border-radius: 4px; color: var(--accent); font-size: 11px; }
.obf-pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; letter-spacing: .4px;
            background: var(--surface3); color: var(--text-dim); }
.obf-pill.pass { background: rgba(52,211,153,0.14); color: var(--ok); }
.obf-pill.fail { background: rgba(242,84,91,0.16); color: var(--danger); }
.map-tag { font-family: var(--font); font-size: 10.5px; color: var(--accent2); background: var(--surface3);
           padding: 1px 6px; border-radius: 4px; margin-right: 4px; white-space: nowrap; }

/* ── INPUTS ── */
textarea {
  width: 100%; background: #080c14; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: var(--font); font-size: 12px;
  padding: 12px; resize: vertical; outline: none; line-height: 1.6;
}
textarea:focus { border-color: var(--accent); }

select, input[type=text] {
  background: var(--surface2); border: 1px solid var(--border-hi);
  color: var(--text); font-family: var(--font); font-size: 12px;
  padding: 7px 10px; border-radius: 8px; outline: none;
  transition: border-color .15s;
}
select:focus, input[type=text]:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }

/* ── MISC ── */
[title] { cursor: help; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── BÚSCAME ── */
.bus-form { display: flex; flex-direction: column; gap: 12px; }
.bus-row  { display: flex; gap: 14px; flex-wrap: wrap; }
.bus-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 160px; }
.bus-field-action { justify-content: flex-end; flex-direction: row; align-items: flex-end; gap: 8px; flex: 0 0 auto; }
.bus-input { width: 100%; background: var(--surface2); border: 1px solid var(--border-hi);
  color: var(--text); font-family: var(--font); font-size: 12px;
  padding: 8px 10px; border-radius: 8px; outline: none; transition: border-color .15s; }
.bus-input:focus { border-color: var(--accent); }

/* results grid */
.bus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.bus-source-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.bus-source-card:hover { border-color: var(--border-hi); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.bus-source-card .bsc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.bus-source-card .bsc-flag { font-size: 18px; line-height: 1; }
.bus-source-card .bsc-name { font-size: 11px; font-weight: 700; color: var(--text); flex: 1; }
.bus-source-card .bsc-tag  { font-size: 10px; padding: 2px 6px; border-radius: 999px;
  background: rgba(56,189,248,0.12); color: var(--accent2); letter-spacing: .3px; }
.bus-source-card .bsc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.bus-source-card .bsc-desc { font-size: 11px; color: var(--text-dim); line-height: 1.55; }
.bus-source-card .bsc-links { display: flex; flex-direction: column; gap: 5px; }
.bus-link {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px; text-decoration: none;
  font-size: 11px; color: var(--accent2);
  background: rgba(56,189,248,0.07); border: 1px solid rgba(56,189,248,0.18);
  transition: background .15s, border-color .15s;
  word-break: break-all;
}
.bus-link:hover { background: rgba(56,189,248,0.14); border-color: var(--accent2); }
.bus-link .bus-link-ico { font-size: 13px; flex-shrink: 0; }
.bus-link .bus-link-label { flex: 1; }
.bus-link .bus-ext { font-size: 10px; opacity: .6; flex-shrink: 0; }

.bus-section-title {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1.4px; padding: 4px 0 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.bus-auto-header {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 14px; background: rgba(20,184,166,0.07);
  border: 1px solid rgba(20,184,166,0.2); border-radius: 8px; margin-bottom: 4px;
}
.bus-auto-label { font-size: 11px; color: var(--accent); }
.bus-progress-wrap {
  background: var(--surface3); border-radius: 999px; height: 5px; overflow: hidden;
}
.bus-progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .35s ease;
}
.bus-link-launched {
  background: rgba(52,211,153,0.1) !important;
  border-color: rgba(52,211,153,0.3) !important;
  color: var(--ok) !important;
}
.bus-link-launched .bus-ext::before { content: '✅ '; }

.bus-info-box {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px; background: rgba(20,184,166,0.06);
  border: 1px solid rgba(20,184,166,0.2); border-radius: 8px;
  font-size: 11px; color: var(--text-dim); line-height: 1.6;
}
.bus-info-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.bus-empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
  font-size: 12px; line-height: 1.8;
}
.bus-empty .bus-empty-ico { font-size: 36px; display: block; margin-bottom: 12px; opacity: .5; }
.bus-no-match {
  padding: 10px 14px; background: rgba(240,169,76,0.07);
  border: 1px solid rgba(240,169,76,0.2); border-radius: 8px;
  font-size: 11px; color: var(--warn);
}

/* ── HASHES / ENTROPÍA ── */
.hash-jar {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.hash-jar code {
  font-family: var(--font); font-size: 11px; color: var(--accent2);
  word-break: break-all; background: #080c14;
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px;
}
.ent-danger { color: var(--danger); font-weight: 700; }
.ent-warn   { color: var(--warn); font-weight: 700; }
.ent-ok     { color: var(--ok); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .layout { height: auto; min-height: calc(100vh - 60px); }
  .sidebar { width: 100%; min-width: 0; display: flex; overflow-x: auto; padding: 6px; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-sep, .sidebar-label { display: none; }
  .sidebar-item { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .sidebar-item.active { border-left: none; border-bottom-color: var(--accent); background: var(--accent-soft); }
  .layout { flex-direction: column; }
  .tab-content { padding: 14px; }
  .split { flex-direction: column; }
  .split-left { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid var(--border); max-height: 220px; }
  .header > span:last-child { display: none; }
}